- print_r: documentation ( source)
- json_encode: documentation ( source)
<?php
print_r(array(
'JSON_ERROR_NONE' => JSON_ERROR_NONE,
'JSON_ERROR_DEPTH' => JSON_ERROR_DEPTH,
'JSON_ERROR_STATE_MISMATCH' => JSON_ERROR_STATE_MISMATCH,
'JSON_ERROR_CTRL_CHAR' => JSON_ERROR_CTRL_CHAR,
'JSON_ERROR_SYNTAX' => JSON_ERROR_SYNTAX,
'JSON_ERROR_UTF8' => JSON_ERROR_UTF8,
'JSON_ERROR_RECURSION' => JSON_ERROR_RECURSION,
'JSON_ERROR_INF_OR_NAN' => JSON_ERROR_INF_OR_NAN,
'JSON_ERROR_UNSUPPORTED_TYPE' => JSON_ERROR_UNSUPPORTED_TYPE
));
$vTest = array("test"=> null);
echo json_encode($vTest);