Quote:
Originally Posted by harmor19
Below that line add
PHP Code:
$comment = stripslashes($comment);
|
Works wonderfully, thanks! And much to my surprise it even leaves slashes originally entered as part of the text intact.
Quote:
Originally Posted by Code Monkey
Why don't you just use the php function nl2br();
nl2br(string string) //Inserts HTML line breaks before all newlines in a string
|
Thanks for this. It's certainly easier for me to understand the coding without having to deal with the regex.
But still getting the \' , so still have to use stripslashes().
Any idea which of the two approaches is less server intensive?