我想嘗試通過array_push僅將已填充的行存入另一個數組,但我不能動態地取出它們,因爲第一個索引是字符串,我該如何正確執行它?謝謝。從多維數組中取第一個索引爲字符串的填充行
<?php
while($i < count($val['error']){
if($val['error'][$i] === 0)
{
array_push($newarray, $val[whatwilliputherebecauseofstringindex][$i]);
}
}
?>
使用'的foreach($數組作爲$密鑰=> $ VAL)'循環。那麼你可以使用'$ key' –
在這裏不工作是完整的代碼http://pastebin.ca/2476420 –
所以你有一個「之前」你的數組在pastebin中。在你想要的 –