note 60912 deleted from function.preg-replace by felipe
| From: | felipe@php.net | Date: | Mon, 10 Dec 2007 02:07:55 +0000 |
| Subject: | note 60912 deleted from function.preg-replace by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-133091@lists.php.net to get a copy of this message | ||
Note Submitter: SG_01
----
Re: wcc at techmonkeys dot org
You could put this in 1 replace for faster execution as well:
<?php
/*
* Removes all blank lines from a string.
*/
function removeEmptyLines($string)
{
return preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $string);
}
?>