我有阵列这样如何找到空值在多维数组特定键
<?php
$array =
array
(
array (
0 => 1,
1 => 'php',
2 => 11,
3 => 11,
4 => 11,
5 => 11,
6 => 11,
),
array (
0 => 1,
1 => 'php',
2 => 11,
3 => 11,
4 => 11,
5 => 11,
6 => ,
),
);
,我想在此多阵列搜索找到如果键[6] =>是empty.if它是空的任何数组的形式返回false,所以如何做到这一点
foreach($array as $item)
{
foreach($item as $key=>$value)
{
print($key);
if($key=="6" && $value==NULL)
{
echo "found";
return false;
}else{
echo "not found";
return true;
}
}
}
看看[此](HTTPS ://gist.github.com/rianrainey/4263778) – Naruto 2015-02-24 15:16:27
看看这个http://php.net/manual/en/function.empty.php – kya 2015-02-24 15:16:31
你写的是什么问题? – Styphon 2015-02-24 15:18:15