Source Code:
(back to article)
<?php $obj = new stdClass(); $obj->name = "John"; $obj->age = 30; $obj->city = "New York"; $json = json_encode($obj); echo $json; ?>
Result:
Report an issue