note 75713 added to function.preg-replace
| From: | anon at osu1 dot php dot net | Date: | Wed, 13 Jun 2007 00:29:16 +0000 |
| Subject: | note 75713 added to function.preg-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-127432@lists.php.net to get a copy of this message | ||
For the benefit of perl coders,
$s =~ s/PATTERN/REPLACEMENT/g;
becomes:
<?
$s = preg_replace('/PATTERN/', 'REPLACEMENT', $s);
?>
Note that you have to assign the result back to $s. If your preg_replace doesn't seem to be
working, you may have merely forgotten to assign the return to $s.
----
Server IP: 69.39.81.135
Probable Submitter: 69.232.64.135
----
Manual Page -- http://www.php.net/manual/en/function.preg-replace.php
Edit -- https://master.php.net/note/edit/75713
Del: integrated -- https://master.php.net/note/delete/75713/integrated
Del: useless -- https://master.php.net/note/delete/75713/useless
Del: bad code -- https://master.php.net/note/delete/75713/bad+code
Del: spam -- https://master.php.net/note/delete/75713/spam
Del: non-english -- https://master.php.net/note/delete/75713/non-english
Del: in docs -- https://master.php.net/note/delete/75713/in+docs
Del: other reasons-- https://master.php.net/note/delete/75713
Reject -- https://master.php.net/note/reject/75713
Search -- https://master.php.net/manage/user-notes.php