note 49577 deleted from function.preg-replace by didou
| From: | didou@php.net | Date: | Sun, 23 Apr 2006 22:53:44 +0000 |
| Subject: | note 49577 deleted from function.preg-replace by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-109237@lists.php.net to get a copy of this message | ||
Note Submitter: mzvarik at gmail dot com
----
This erase white-spaces on the beginning and the end in each line of a string:
<?
$str = ' 1. blah
2. blah bla
3. fdf ads fdf ';
echo preg_replace('~^(\s*)(.*?)(\s*)$~m', "\\2", $str);
?>