note 54592 deleted from function.quotemeta by nlopess
| From: | nlopess@php.net | Date: | Fri, 17 Feb 2006 11:15:24 +0000 |
| Subject: | note 54592 deleted from function.quotemeta by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-103904@lists.php.net to get a copy of this message | ||
Note Submitter: matt at bueller dot ca
----
$pattern = preg_replace("/\|/", "\\|", quote_meta($pattern));
would probably be better written as:
$pattern = str_replace("|", "\\|", quote_meta($pattern));
This will more effecient (especially in tight loops) than using a regex pattern.