I've got a basic textarea form. What i'm trying to do is remove all line breaks from the textarea after its been submitted.
Here's my PHP:
<?php
if (isset ($_POST['comment_form_submit'])) {
$body = mysql_real_escape_string($_POST['body']);
$breaks = array("
", "
", "");
$newtext = str_replace($breaks, "", $body);
echo $newtext;
}
?>
Now let say I when filling out the form I press Shift+enter, that creates a in my string, but after submitting the form, $newtext still equals " ", shouldn't " " be removed because I'm replacing it with ""
Thanks.