note 51545 deleted from function.preg-replace by didou
| From: | didou@php.net | Date: | Sun, 23 Apr 2006 22:52:44 +0000 |
| Subject: | note 51545 deleted from function.preg-replace by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-109233@lists.php.net to get a copy of this message | ||
Note Submitter: php at hr-ws dot de
----
if you have an unknown text as a replace string and you don't want any occurences of $ followed
by a number act as a backreference make sure that all $ characters are escaped.
Otherwise your resulting string will be shorter when your searchstring doesn't contain any
subpattern
example:
<?php
// $replace defined elsewhere as
$replace = "costs $1.00";
preg_replace("/findthis:.*?\n/", $replace, $text);
?>