我已经尝试了这两种方法来从该数组中删除 0 值,但无济于事
foreach ($matches as $array_key=>$array_item)
{
if($matches[$array_key] == 0)
{
unset($matches[$array_key]);
}
}
var_dump ($matches[$array_key]);
和这个
$matches_without_nulls = array_filter($matches);
print_r($matches_without_nulls[1]);
但是,我不断得到的字符串是这个
{ [0] => string(7) "2337667" [1] => string(7) "2335765" [2] => string(7) "2332651" [3] => string(7) "2328582" [4] => string(1) "0" [5] => string(1) "0" [6] => string(1) "0" [7] => string(1) "0" }
对正在发生的事情有任何想法吗?