Source Code:
(back to article)
<?php $json = '{"name":"John", "age":30, "city":"New York}'; $array = json_decode($json, true); if ($array === null) { echo "Error decoding JSON"; } else { print_r($array); } ?>
Result:
Report an issue