I have the following array that contains associative arrays:
array( [0] => array ("name" => "foo", //more key-value pairs) [1] => array ("name" => "bar", //more key-value pairs) [2] => array ("name" => "baz", //more key-value pairs) ) How can I check if a name exists while iterating over another array of names:
foreach ($list_of_names as $name) { // does the current name exist in the other array? } Is there a way to do it without nesting foreach loop inside the foreach loop?