note 78112 added to function.preg-replace
| From: | adiwicaksono at yahoo dot com | Date: | Fri, 28 Sep 2007 03:24:31 +0000 |
| Subject: | note 78112 added to function.preg-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-130877@lists.php.net to get a copy of this message | ||
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
----
Server IP: 202.79.178.90
Probable Submitter: 203.126.114.17
----
Manual Page -- http://www.php.net/manual/en/function.preg-replace.php
Edit -- https://master.php.net/note/edit/78112
Del: integrated -- https://master.php.net/note/delete/78112/integrated
Del: useless -- https://master.php.net/note/delete/78112/useless
Del: bad code -- https://master.php.net/note/delete/78112/bad+code
Del: spam -- https://master.php.net/note/delete/78112/spam
Del: non-english -- https://master.php.net/note/delete/78112/non-english
Del: in docs -- https://master.php.net/note/delete/78112/in+docs
Del: other reasons-- https://master.php.net/note/delete/78112
Reject -- https://master.php.net/note/reject/78112
Search -- https://master.php.net/manage/user-notes.php