note 50067 deleted from function.preg-quote by colder
| From: | colder@php.net | Date: | Mon, 18 Jun 2007 18:38:03 +0000 |
| Subject: | note 50067 deleted from function.preg-quote by colder | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-127643@lists.php.net to get a copy of this message | ||
Note Submitter: rdude at fuzzelfish dot com
----
Another character that preg_quote will not escape is the all important "/" character. You
will need to convert "/" into "\/" yourself. For example, this code does not
work:
<?
$TEXT = preg_replace('/[' . preg_quote('abc/') . ']/', '',
$TEXT);
?>
However, this does:
<?
$TEXT = preg_replace('/[' . preg_quote('abc') . '\/]/', '',
$TEXT);
?>