I have an array like the following in PHP:
$my_array = array(); $my_array[] = array(\"id\"=>\"myid1\", \"name\"=>\"myname1\"); $my_array[] = array(\"id\"=&
Please use
$id = array_filter( array_map( function($array) { if($array['name']== 'othername'){ return $array['id']; } },$my_array ) ); print "";print_r($id);
";print_r($id);