php find in array multidimensional code example
Example 1: php group multidimensional array by value
function arraySort($input,$sortkey){
foreach ($input as $key=>$val) $output[$val[$sortkey]][]=$val;
return $output;
}
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);
?>