- var_dump: documentation ( source)
- version_compare: documentation ( source)
- json_encode: documentation ( source)
<?php
$structure = array(
'id' => 11231,
'message' => "Hello!",
'num_str' => "3",
'num_int' => 3,
'num_float' => 3.0,
'num_big' => 2123123154123341223341562341238712389712331123231123123123121331231,
);
$options = 0;
if (version_compare(PHP_VERSION, '5.4.0') >= 0) {
$options = $options | JSON_PRETTY_PRINT;
}
var_dump(json_encode($structure, $options));