php - Fail on Decode my json string :( -
this question has answer here:
- how extract data json php? 2 answers
how decode php
$myjson = [{"type":"laser","material":"1","quantity":1000}, {"type":"motors","material":"1","quantity":1491477212}, {"type":"shield","material":"1","quantity":1491531189}, {"type":"hp","material":"1","quantity":1491531201}] ;
check code, missed "'" in start , end "'". have format can use code
<?php $myjson = '[{"type":"laser","material":"1","quantity":1000},{"type":"motors","material":"1","quantity":1491477212},{"type":"shield","material":"1","quantity":1491531189},{"type":"hp","material":"1","quantity":1491531201}]' ; $array = json_decode($myjson); echo "<pre>"; print_r($array);
Comments
Post a Comment