note 42978 added to function.preg-replace
| From: | nobody at rn2 dot php dot net | Date: | Sat, 05 Jun 2004 11:25:14 +0000 |
| Subject: | note 42978 added to function.preg-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-70655@lists.php.net to get a copy of this message | ||
To remove excess spaces, try:
<?php
preg_replace('#\s{2,}#s', ' ', $str);
?>
----
Manual Page -- http://www.php.net/manual/en/function.preg-replace.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+42978
Delete -- http://master.php.net/manage/user-notes.php?action=delete+42978&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+42978&report=yes
Search -- http://master.php.net/manage/user-notes.php