Trim() will in fact only strip whitespace from the beginning or end of
the string; if he has \n's anywhere in the middle of the string, trim
will do perform the desired operation.

Ereg_replace() is unnecessary for a simple search/replace operation;
str_replace() will suffice and is faster to some degree.

Try: $str = str_replace("\n", '', $str);

--Toby

Brian Clark wrote:
> 
> Hi Kath,
> 
> @ 9:41:34 PM on 2/16/2001, [EMAIL PROTECTED] wrote:
> 
> > You want to totally remove \n?
> 
> > $something = ereg_replace("\n"," ",$something);
> 
> trim() will suffice.
> 
> http://www.php.net/manual/en/function.trim.php
> 
> -Brian
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to