Source Code:
(back to article)
<?php $json = '{"name":"John","age":30,"city":"New York"}'; $obj = json_decode($json); echo $obj->name; // outputs "John" echo $obj->age; // outputs 30 echo $obj->city; // outputs "New York" ?>
Result:
Report an issue