- print_r: documentation ( source)
- json_encode: documentation ( source)
<?php
$arr = array( 'camelCase' => 'value and things', 'non_camel_case' => 'Other stuff', 'list' => array('a','b','c'));
print_r($arr);
$json = json_encode($arr, FALSE);
echo $json;