would suggest "/(\r\n|\r|\n)+/" especially if the input is from a
browser that could be mac, or windows.. :)

--
=======================================================================
Michael J. Ryan  -  tracker1[*at*]theroughnecks.com
Roughneck BBS: http://www.theroughnecks.net  telnet://theroughnecks.net
=======================================================================
Y!: aztracker1 - aim: azTracker1 - icq: 4935386 - msn: see email
One program for aim/icq/yahoo/msn/irc  -  http://www.trillian.cc/


"Bb" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> $var = preg_replace("/\n*/","\n",$var);
> "Jason Caldwell" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Is there an elegant way to remove excess blank lines from my form data?
> >
> > For example;  if someone enters the following text and then press' the
> > Submit button:
> >
> >     ----
> >     This is a some text
> >
> >
> >     This is more text, and yet even more....
> >     ----
> >
> > What I want to do is remove the excess white space and make it look like
> > this?
> >
> >     ----
> >     This is a some text
> >
> >     This is more text, and yet even more....
> >     ----
> >
> > My users may press <enter> too many times and I want to ensure clean text
> > and formatting.
> >
> > Thanks.
> > Jason
> >
> >
> >
> >
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to