[{"goods_id":"416","number":"5"},{"goods_id":"162","number":"2"}] 轉化爲
array(2) { [0] => array(2) { ["goods_id"] => string(3) "268" ["number"] => string(1) "3" } [1] => array(2) { ["goods_id"] => string(3) "144" ["number"] => string(1) "2" } }
使用:json_decode($goodsStr,true); 加上true即可解決。