note 46185 deleted from function.preg-replace by nlopess
| From: | nlopess@php.net | Date: | Sun, 10 Oct 2004 10:25:24 +0000 |
| Subject: | note 46185 deleted from function.preg-replace by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-78269@lists.php.net to get a copy of this message | ||
Note Submitter: damvc at yahoo dot com dot ar
----
I noted that using preg_replace to add a front and back slash to a word it responded in a strange
way. For example to replace "PCRE" by "/PCRE/".
Using:
<?php
preg_replace("/.*/", "/$0", "PCRE");
?>
returns "/PCRE" and using:
<?php
preg_replace("/.*/", "/$0/", "PCRE");
?>
returns "/PCRE///".
I unknown why this happen.
Daniel.