Home  |  Linux  | Mysql  | PHP  | XML
Date:Thu Feb 26 20:21:52 2004
Subject:Re: need to remove newline characters from form input
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" <primeooze@hotmail.com> wrote in message news:20040226195911.84897.qmail@pb1.pair.com...
> 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
Navigate in group php.lang at sever news.php.net
Previous Next





  
© No Copyright
You are free to use Anything, but please consult your advocate before doing so as this website
also list content from other sources which may be copyrighted.
Site Maintained by Zareef Ahmed
Powered By PHP Consultants