how to get index of element in array in php code example
Example 1: how to lookup value inside object php
$array = [
'clothes' => 't-shirt',
'size' => 'medium',
'color' => 'blue',
];
extract($array);
echo("$clothes $size $color"); // t-shirt medium blue
Example 2: array_search in php
<?php
$a = [
'Canceled' => 1,
'Traded / Filled'=> 2,
'(Not used currently)'=> 3,
'Transit'=> 4,
'Rejected'=> 5,
'Pending'=> 6,
];
echo array_search("5",$a);
?>