Tuesday, 27 August 2013

PHP detecting line breaks in text field

PHP detecting line breaks in text field

I'm trying to split up the POST data of a text form field. I want the data
split by each line, using the explode() function
So first I check the POST result for strange characters;
$mails = mysql_real_escape_string($_POST["emails"]);
Then I run this, which doesn't work
$emails = explode("\r\n", $mails);
What am I doing wrong? Is it not \r\n ? Is my sql escape bit messing me up?

No comments:

Post a Comment