Hi I am trying to array_search for associative array in Php but the function isnot working as expected. can anyone help me with this. currently using php version 5.4
<?php
$mainArray = array("array1","array2","array3");
$array1 = array("item"=>"apple","price"=>2);
$array2 = array("item"=>"banana","price"=>3);
$array3 = array("item"=>"carrot","price"=>4);
echo phpversion();
echo "this line ".array_search("apple", array_column($mainArray,'item'));
echo "end";
?>