note 41317 modified in function.preg-replace by aidan
| From: | aidan@php.net | Date: | Thu, 04 Nov 2004 05:06:08 +0000 |
| Subject: | note 41317 modified in function.preg-replace by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-79581@lists.php.net to get a copy of this message | ||
The following will remove consecutive whitespaces.
<?php
$string = preg_replace("/\s\s+/", " ", $string);
?>
--was--
The following will remove consecutive whitespaces.
<?php
$string = preg_replace("/ +/", " ", $string);
?>
http://php.net/manual/en/function.preg-replace.php