note 41317 modified in function.preg-replace by aidan
| From: | aidan@php.net | Date: | Sun, 22 Aug 2004 13:10:03 +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-75107@lists.php.net to get a copy of this message | ||
The following will remove consecutive whitespaces.
<?php
$string = preg_replace("/ +/", " ", $string);
?>
--was--
The following will remove consecutive whitespaces.
$string = preg_replace( "/ +/", " ", $string );
http://php.net/manual/en/function.preg-replace.php