Re: fixing new lines from <textarea> in an email?

From: Date: Fri, 26 Jun 2009 16:50:48 +0000
Subject: Re: fixing new lines from <textarea> in an email?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-294661@lists.php.net to get a copy of this message
Daniel Brown wrote:
    In a cursory glance, I've noticed the following code:
htmlspecialchars(nl2br(str_replace('\r','',$_POST["problem"])))
    You are using a literal '\r' in your str_replace() function.  This
should instead be replaced with double quotes to translate the \r to its appropriate EOL character: htmlspecialchars(nl2br(str_replace("\r",'',$_POST["problem"])))
Thanks, I didn't know that single vs double quotes in that instance made a difference. I've made the change to my code.

« previous php.general (#294661) next »