我有一個具有以下結構的JSON。通過JSON循環並將值存儲到PHP數組中
{
"1":{"Itemname":"dtfg","unitprice":"12","Qty":"4","price":"$48.00"},
"2":{"Itemname":"kjh","unitprice":"45","Qty":"7","price":"$315.00"},
"3":{"Itemname":"yjk","unitprice":"76","Qty":"8","price":"$608.00"},
"4":{"Itemname":"hgj","unitprice":"4","Qty":"45","price":"$180.00"}
}
我需要ITEMNAME被製作成一個PHP數組,單價成另一個,數量到另一個和價格到另一個。我怎麼做?
[json_decode()](http://php.net/manual/en/function.json-decode.php),然後使用[array_column()](http://php.net/manual/en/ function.array-column.php) –
我不知道如何在這裏使用array_column。你可以請秀嗎? –
[演示使用array_column](https://3v4l.org/kP2C7) –