Opposite of nl2br? Is it str_replace?
- by Julian H. Lam
So the function nl2br is handy. Except in my web app, I want to do the opposite, interpret line breaks as new lines, since they will be echoed into a pre-filled form.
str_replace can take <br /> and replace it with whatever I want, but if I put in \n, it echoes literally a backslash and an n. It only works if I put a literal line break in…