Re: need to remove newline characters from form input

[email protected] ("Five") Thu, 26 Feb 2004 15:21:52 -0500
Newsgroups php.lang
Message-ID <[email protected]>
I think, after 4 hours of  searching functions and exxperimentation I've found a simple yet elegant solution.

$message = ereg_replace( "\n", " ", $message);

It seems to replace all new line instances with a blank space.

Wooohooo!

"Five" <[email protected]> wrote in message news:[email protected]...
> I'm writing a simple threaded message board using only php.
>
> I have it worked out except for having to make sure the user input from a <TEXTAREA> doesn't have new line characters. I need to
add
> those myself. Is there an easy way, short of checking each character in a loop, to rid input of new line characters.
>
> Also, ( this might come in handy lol ) what new line character is created when the user presses the Enter key when filling a form
> field? If they aren't " \n" I'm not sure what Im looking for.
>
> much advance thanks,
> Dale