php json_encode beutify newline code example Example: php json_encode beautify json_encode($data, JSON_PRETTY_PRINT)