Is there a way to see invisible characters like whitespace, newlines, and other non-printing characters in a manner like print_r() ?
Reason is there is some sort of
You can use the addcslashes function:
string addcslashes ( string $str, string $charlist )
which will return a string with backslashes before characters. An example would be: