我有這個數組:如何訪問此多維數組內的數據?
$items_pool = Array (
[0] => Array ([id] => 1 [quantity] => 1)
[1] => Array ([id] => 2 [quantity] => 1)
[2] => Array ([id] => 72 [quantity] => 6)
[3] => Array ([id] => 4 [quantity] => 1)
[4] => Array ([id] => 5 [quantity] => 1)
[5] => Array ([id] => 7 [quantity] => 1)
[6] => Array ([id] => 8 [quantity] => 1)
[7] => Array ([id] => 9 [quantity] => 1)
[8] => Array ([id] => 19 [quantity] => 1)
[9] => Array ([id] => 20 [quantity] => 1)
[10] => Array ([id] => 22 [quantity] => 1)
[11] => Array ([id] => 29 [quantity] => 0)
)
我通過這個數組試圖環和執行基於$items_pool[][id]
的價值條件。然後我想要返回TRUE或NULL/FALSE,所以我只是測試具體的存在。
有點不清楚你想才達到什麼......請舉一個例子... – 2010-04-09 22:30:12
*(參考)* http://de2.php.net/manual/en/language.types.array.php,http://de2.php.net/manual/en/language.control-structures.php – Gordon 2010-04-09 22:34:36
http://stackoverflow.com/questions/2611040/how-do-i-make-these-fields-autopopulate-from-the-database/2611449#2611449 - grrr;生氣的樣子。 – bigstylee 2010-04-09 23:02:39