Serializing PHP object to JSON

In the simplest cases type hinting should work:

$json = json_encode( (array)$object );

Leave a Comment