可能重複:
Able to see a variable in print_r()'s output, but not sure how to access it in code我可以將數組存儲在變量中嗎?
我可以存儲在一個變量數組?
我有此數組:
$_POST['product']
,當我打印:
echo "<PRE>";
print_r($_POST['product']);
echo "</PRE>";
結果是:
<PRE>Array
(
[0] => Array
(
[0] => 1
[1] => cola
[2] => wwww
[3] => 1
[4] => 2.00
[5] => 0.00
[6] => 2.00
)
)
</PRE>
我怎麼能存儲陣列中的價值一個變量?例如,我需要將[1] => cola
插入數據庫的表中。
你能剛...更清楚一點?你在談論'$ _POST ['product'] [0] [1]'? –