note 71724 added to function.str-replace
| From: | Faroul at osu1 dot php dot net | Date: | Wed, 13 Dec 2006 13:22:04 +0000 |
| Subject: | note 71724 added to function.str-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-120574@lists.php.net to get a copy of this message | ||
use ' (single quotes) to avoid parsing of the string;
so
<?php
$content = 'This is $12.95';
echo preg_replace("/%cont%/", $content, $html);
?>
would work fine (although preg_replace() in this place is quite overused :)
----
Server IP: 212.124.37.9
Probable Submitter: 212.60.14.93
----
Manual Page -- http://www.php.net/manual/en/function.str-replace.php
Edit -- https://master.php.net/note/edit/71724
Del: integrated -- https://master.php.net/note/delete/71724/integrated
Del: useless -- https://master.php.net/note/delete/71724/useless
Del: bad code -- https://master.php.net/note/delete/71724/bad+code
Del: spam -- https://master.php.net/note/delete/71724/spam
Del: non-english -- https://master.php.net/note/delete/71724/non-english
Del: in docs -- https://master.php.net/note/delete/71724/in+docs
Del: other reasons-- https://master.php.net/note/delete/71724
Reject -- https://master.php.net/note/reject/71724
Search -- https://master.php.net/manage/user-notes.php