Hi,
I'm taking in some text input from a textarea field, and I'd like to remove newlines from it. I've used nl2br and
$text = ereg_replace("\n", "<BR>", $text);
but these just add in a BR tag so that the HTML appears to have a newline. It doesn't remove the actual newline from the text. Is there a way to remove the newlines completely?
eg.
My text input is like this:
Currently I can only edit it to this:
But I'd like it to be formatted to this:
Can anyone help? Thanks in advance if you do!