converting special symbols to escaped characters and vice versa

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Say I wanted to convert strings like '\n' to "\n" or '\r' to "\r".
Without using a bunch of successive str_replaces, how might I go about
doing that?  Is there some built-in PHP function that'd let me do that?

Any help would be appreciated - thanks!

Site Timeline