- json_encode: documentation ( source)
<?php
$result = (object)array(
'Answer' => (object)array('Sucess'=>'Yup'),
'List' => array(
(object) array('id' => 1, 'Description' => 'hello'),
)
);
print json_encode($result);