2016-09-21 62 views
-1

我從所有的訂單我不得不進口以下字符串:PHP json_decode多個對象(訂單)

[ 
{"BestellungID":"1","KundeID":"1","Anrede":"Herr"}, 
{"BestellungID":"2","KundeID":"2","Anrede":"Herr"}, 
{"BestellungID":"3","KundeID":"3","Anrede":"Herr"} 
] 

我如何能夠解碼所有元素每一份訂單? 輸出來自json編碼的數組。

回答

2

您可以使用json_decode

$array = json_decode($json, true); 
+0

謝謝!不要以爲這很容易:) – Patrick