I'll answering it myself so that no one else has to bother;

$str = ereg_replace("[[:space:]]+", " ", trim($str));


. bobo

----- Original Message -----
From: "Bobo Wieland" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 30, 2003 8:26 AM
Subject: [PHP-WIN] Something like trim()


> Is there an easy way to get rid off white space characters in a string?
Like
> trim() but for the whole string and leaving single white spaces as they
are
> but removing all occurences of '\t','\n' and '     '(leaving a single '
> ')...
>
> I've tried the manual but couldn't find anything...
>
>
>
> . bobo . www.elstudion.com . www.elstudion.com/bobo .
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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

Reply via email to