Re: removing ALL whitespace from a string
| From: | Andrey Hristov | Date: | Mon, 11 Mar 2002 16:59:51 +0000 |
| Subject: | Re: removing ALL whitespace from a string | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-88039@lists.php.net to get a copy of this message | ||
$new=preg_replace('/\s/','',$old);
Best regards,
Andrey Hristov
----- Original Message -----
From: "Lee P Reilly" <lreilly@lanl.gov>
To: "PHP List" <php-general@lists.php.net>
Sent: Monday, March 11, 2002 6:56 PM
Subject: [PHP] removing ALL whitespace from a string
> Can somebody tell me if there is a function that will remove *all*
> whitespace (\n, \r, \t, \w, etc) from a string i.e. from the beginning,
> the end, and the middle?. Something like chop(), trim()?
>
> e.g. input = " 1 2 3 ad "
> e.g. output = "123ad"
>
> Thanks,
>
> Lee
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>