日期:2014-05-17 浏览次数:20461 次
$arr = array ( 0 => array ( 0 => 'question three', 'detail' => 'question three', ), 1 => array ( 0 => 'question four', 'detail' => 'question four', ), 2 => array ( 0 => 'question five', 'detail' => 'question five', ), ); $test = array(0 => 'question three', 'detail' => 'question three',); if (in_array($test,$arr)) { echo 'yes'; }
------解决方案--------------------
foreach($var as $key=>$val){
foreach($val as $k=>$v){
if(in_array('c',$v)){
echo "C";
}else{
echo "N";
}
}
}
不知道你的具体是什么样的数组,这样应该可以,你可以试试。