Inserting a Hard Return

He has: 1,380 posts

Joined: Feb 2002

"WASSSSSSSSSSSSUPPPPPPPPPPP"

Anyways...I have a form that is submitted to a MySQL dB by PHP, and in that form there are all sorts of ' ? ! and things, as well as hard returns (what or \n does). Then another piece of PHP grabs the data and displays it. How can I parse so that the hard returns, on submission, enter \n in place of it, and how do you parse ' " ? ! to display normally, instead of being

Quote:
hello y\'all

Thanks!

Chroder's picture

He has: 91 posts

Joined: Mar 2004

If I understood you correctly, stripslashes() should be what your looking for.

<?php
$mytext
= stripslasehs($crazytext);
?>

He has: 1,380 posts

Joined: Feb 2002

Thanks...but I am also looking for more than that...when you have something like this:

Quote: Hello.
I am jello.

it needs to be

Quote: Hello.\nI am jello.

Busy's picture

He has: 6,151 posts

Joined: May 2001

something like nl2br ?

He has: 1,380 posts

Joined: Feb 2002

Yes'm. Thanks.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.