note 78112 rejected from function.preg-replace by nlopess
| From: | nlopess@php.net | Date: | Fri, 28 Sep 2007 19:36:23 +0000 |
| Subject: | note 78112 rejected from function.preg-replace by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-130892@lists.php.net to get a copy of this message | ||
Note Submitter: adiwicaksono at yahoo dot com
----
Hi, how to solve this?
<?
$template = "Price: #price#";
$price = '$5';
print "Price: $price\n";
$res = preg_replace("/#price#/",$price,$template);
print "From template: -> $res\n";
?>
Current result:
Price: $5
From template: -> Price:
I want this result:
Price: $5
From template: -> Price: $5