我有一个这样的数组:
array(
[0] => array("description" => "old, white, brown_hair", "name" => "jacques"),
[1] => array("description" => "young, black, black_hair", "name" => "jack")
);
现在我想检查数组是否包含jack
。我试过了this。
答案 0 :(得分:0)
您可以使用简单的foreach
foreach($arr as $k=>$arr1)
{
if(in_array('jack',$arr1))
{
echo 'jack exists ! exiting....';
break;
}
}