note 80659 deleted from function.preg-quote by felipe
| From: | felipe@php.net | Date: | Tue, 29 Jan 2008 11:47:37 +0000 |
| Subject: | note 80659 deleted from function.preg-quote by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-135534@lists.php.net to get a copy of this message | ||
Note Submitter: codepowered doot com et leon
Reason: 1
----
Note that as of ver 5.2.5 this function does not replace the dash (`-') character.
This can cause problems if you are going to put the quoted string in square brackets in the regular
expression.
Do something like:
<?php
function pregquote($str) {
return str_replace('-', '\\-', preg_quote($str));
}
?>