I have an array $arr.
when I print this it shows the results as follows.
Array ( [0] => Array ( [name] => homeandgarden-Con
I think you are looking for this:
function getIndex($name, $array){ foreach($array as $key => $value){ if(is_array($value) && $value['name'] == $name) return $key; } return null; }