Q:

How can I see '\r\n' in my var_dump or print_r?

Im trying to debug where the problem is in this dynamic input generator tool that another dev made.  He uses '\r\n' to basically explode values to be stored as options in a select.  Im trying to work out where this isnt being done because when the select is rendered the string is coming out of the database as one long string.  I ran it through a nl2br to verify as well.
SO I've determined the problem is when the data is being saved to the database on the edit command as it seems to be working on the create.  But thats somewhat besides the point....
My question is thus:  is there a simple way to have a var_dump or print_r function include '\r\n' s in their output?
All i can really think to do is replace these characters with something else before outputting which is kind of a pain so it would be awesome if theres an easier way.

A:

Double the backslashes with preg_replace
<?php var_dump(preg_replace(array('/\n/','/\t/','/\s/'), array('\\\\n', '\\\\t', '\\\\s'), "\n\n"));

You can write a function to don't need to repeat this code all the time, I also like to put my var_dump's inside <pre> tags.

