JSON encoding serializes raw text (or PHP print_r() dumps) into a valid JSON literal by escaping double quotes (\"), backslashes (\\), newlines (\n), tabs (\t), and control characters. This ensures multi-line strings or HTML snippets can be embedded safely inside JSON objects, API requests, and config files.
print_r() Support: Check String is PHP print_r output to convert legacy PHP debug dumps into structured JSON.