Re: how to replace many spaces with one space?
| From: | David Otton | Date: | Sun, 25 Oct 2009 15:59:56 +0000 |
| Subject: | Re: how to replace many spaces with one space? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-299320@lists.php.net to get a copy of this message | ||
2009/10/25 Jeffry Lunggot <jeffry@rogon.com.my>:
> Hi,
>
> how to replace many spaces in any string of character with one space?
$str = preg_replace('/\s\s+/', ' ', $str);