Re: [PHP] fixing new lines from textarea in an email?

2009-06-27 Thread WenDong Zhang
how about preg_replace('/(\\n}\\r\\n)/', 'br /', $_POST[problem]); On Sat, Jun 27, 2009 at 12:50 AM, Adam Williams awill...@mdah.state.ms.uswrote: Daniel Brown wrote: In a cursory glance, I've noticed the following code: htmlspecialchars(nl2br(str_replace('\r','',$_POST[problem])))

Re: [PHP] fixing new lines from textarea in an email?

2009-06-27 Thread tedd
At 11:27 AM -0500 6/26/09, Adam Williams wrote: I have staff fill out a form that contains a textarea with their problem description and emailed to me when they click submit. Staff will press enter in the text area, but I'm having problems converting the \r\n into a new line in the email that

Re: [PHP] fixing new lines from textarea in an email?

2009-06-26 Thread Daniel Brown
On Fri, Jun 26, 2009 at 12:27, Adam Williamsawill...@mdah.state.ms.us wrote: I have staff fill out a form that contains a textarea with their problem description and emailed to me when they click submit.  Staff will press enter in the text area, but I'm having problems converting the \r\n into

Re: [PHP] fixing new lines from textarea in an email?

2009-06-26 Thread Adam Williams
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