Problem: replace \r\n when using echo
Posted: Tue Aug 16, 2011 7:51 pm
I've got a form where I'm properly (hope it's proper!) escaping and trimming entries before entering to my database. The database inserting works properly with all variables clean and special characters escaped. However, I need to DISPLAY one of the form variables on a confirmation page. It's a multipage form, so the escaping and trimming have taken place a page or two before.
If I output my variable
echo $myvar;
gives me everything between the quotes here:
"There\'s a bunch of stuff and the percent is\r\n5% - another percent\r\n6%" .... and so forth
What can I use to simply display this as:
"There's a bunch of stuff and the percent is 5% - another percent 6%"
I tried a combination of stripslashes with a few other things, but it simply is not displaying correctly for me.
Be kind to the newbie...
Thanks
If I output my variable
echo $myvar;
gives me everything between the quotes here:
"There\'s a bunch of stuff and the percent is\r\n5% - another percent\r\n6%" .... and so forth
What can I use to simply display this as:
"There's a bunch of stuff and the percent is 5% - another percent 6%"
I tried a combination of stripslashes with a few other things, but it simply is not displaying correctly for me.
Be kind to the newbie...
Thanks