我有两个数组一个单维和多维数组,多维它的逗号
分开的
$singledim =Array
(
[0] => 333
[1] => 673
[2] => 434
[3] => 67
)
$multidim = Array
(
[0] => Array
(
[0] => 22
[1] => 3336,673,34,342,432,23,323,434,765675765,7657567
)
[1] => Array
(
[0] => 24
[1] => 2424,10
)
[2] => Array
(
[0] => 28
[1] => 23,12,13,14,15,16
)
............
}
我想使用 in_array 来检查一维数组值是否存在。Belwo 是我尝试过的。
<?
foreach($multidim as $multi)
{
if(in_array($singledim,$multi[1])
{
}
$i++;
}
?>