note 95291 added to function.str-replace
| From: | clouster at yandex dot ru | Date: | Thu, 24 Dec 2009 15:07:17 +0000 |
| Subject: | note 95291 added to function.str-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-164300@lists.php.net to get a copy of this message | ||
Wes Foster, YOU DO IT WRONG :)
<?php
$string = "i know one man who can jump above three feets";
$replace = array(
'one' => 'two',
'three' => 'four'
);
$string = str_replace(array_keys($replace), array_values($replace), $string);
?>
----
Server IP: 195.54.192.44
Probable Submitter: 87.237.114.111
----
Manual Page -- http://www.php.net/manual/en/function.str-replace.php
Edit -- https://master.php.net/note/edit/95291
Del: integrated -- https://master.php.net/note/delete/95291/integrated
Del: useless -- https://master.php.net/note/delete/95291/useless
Del: bad code -- https://master.php.net/note/delete/95291/bad+code
Del: spam -- https://master.php.net/note/delete/95291/spam
Del: non-english -- https://master.php.net/note/delete/95291/non-english
Del: in docs -- https://master.php.net/note/delete/95291/in+docs
Del: other reasons-- https://master.php.net/note/delete/95291
Reject -- https://master.php.net/note/reject/95291
Search -- https://master.php.net/manage/user-notes.php