- json_decode: documentation ( source)
- print_r: documentation ( source)
- json_encode: documentation ( source)
<?php
$an_object = new StdClass();
$an_object->attr = 'value';
$encoded = json_encode($an_object);
print_r(
json_decode($encoded, null, 512, JSON_OBJECT_AS_ARRAY));
print_r(
json_decode($encoded, true, 512, JSON_OBJECT_AS_ARRAY));
print_r(
json_decode($encoded, false, 512, JSON_OBJECT_AS_ARRAY));