List Info

Thread: note 78112 added to function.preg-replace




note 78112 added to function.preg-replace
user name
2007-09-27 22:24:31
Hi, how to solve this?

<?
 $template = "Price: #price#";
 $price    = '$5';
 print "Price: $pricen";
 $res    =
preg_replace("/#price#/",$price,$template);
 print "From template: -> $resn";

 ?>

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  -- h
ttps://master.php.net/note/delete/78112/integrated
Del: useless     -- http
s://master.php.net/note/delete/78112/useless
Del: bad code    -- htt
ps://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     -- http
s://master.php.net/note/delete/78112/in+docs
Del: other reasons-- https://mast
er.php.net/note/delete/78112
Reject      -- https://mast
er.php.net/note/reject/78112
Search      -- https://
master.php.net/manage/user-notes.php

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


note 78112 rejected from function.preg-replace by nlopess
user name
2007-09-28 14:36:23
Note Submitter: adiwicaksono at yahoo dot com 

----

Hi, how to solve this?

<?
 $template = "Price: #price#";
 $price    = '$5';
 print "Price: $pricen";
 $res    =
preg_replace("/#price#/",$price,$template);
 print "From template: -> $resn";

 ?>

Current result:
Price: $5
>From template: -> Price:

I want this result:
Price: $5
>From template: -> Price: $5

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )