- defined: documentation ( source)
- json_encode: documentation ( source)
<?php
$arr = array('a' => 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e' => 5);
if(null !== JSON_PRETTY_PRINT && defined(JSON_PRETTY_PRINT)){
echo json_encode($arr, JSON_PRETTY_PRINT);
echo JSON_PRETTY_PRINT;
}
?>