how to pretty print json in php code example Example: php json pretty print $json_string = json_encode($data, JSON_PRETTY_PRINT);