<?php $people = [ 0 => [ 'name' => 'John', 'fav_color' => 'green', ], 1 => [ 'name' => 'Samuel', 'fav_color' => 'blue', ], ]; $found_key = array_search('green', array_column($people, 'fav_color')); if ($found_key !== false) { print_r("Y"); } else { print_r("N"); }
You have javascript disabled. You will not be able to edit any code.