note 95832 added to function.str-replace
| From: | apocalip at gmail dot com | Date: | Sun, 24 Jan 2010 22:10:50 +0000 |
| Subject: | note 95832 added to function.str-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-165259@lists.php.net to get a copy of this message | ||
@Wes Foster
you don't need the extra function to accomplish something like that.
<?php
$searchReplace = array(
"searchstring" => "replaceString"
);
str_replace(array_keys($searchReplace),array_values($searchReplace), $string);
?>
Greetings Marc
----
Server IP: 217.160.72.57
Probable Submitter: 91.20.175.75
----
Manual Page -- http://www.php.net/manual/en/function.str-replace.php
Edit -- https://master.php.net/note/edit/95832
Del: integrated -- https://master.php.net/note/delete/95832/integrated
Del: useless -- https://master.php.net/note/delete/95832/useless
Del: bad code -- https://master.php.net/note/delete/95832/bad+code
Del: spam -- https://master.php.net/note/delete/95832/spam
Del: non-english -- https://master.php.net/note/delete/95832/non-english
Del: in docs -- https://master.php.net/note/delete/95832/in+docs
Del: other reasons-- https://master.php.net/note/delete/95832
Reject -- https://master.php.net/note/reject/95832
Search -- https://master.php.net/manage/user-notes.php