note 29805 deleted from function.str-replace by didou
| From: | didou@php.net | Date: | Sat, 16 Aug 2003 09:53:27 +0000 |
| Subject: | note 29805 deleted from function.str-replace by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-54319@lists.php.net to get a copy of this message | ||
Note Submitter: igjav@cesga.es
----
This is based on a fair comment signed by:
* brooke at jump dot net *
strtr can "source-replace" complete strings, not only chars, like reminiscences of ancient
languages could suggest:
$permutation = array(strtr('hello, hello and hi', array("hello" =>
"hi", "hi" => "hello")));
So am I wrong if I say that str_replace doesn't makes sense, because you can construct it with:
1)
strtr(array form) for "source-replacing"
2)
[loop struct]+strtr(scalar form) for "transient replacing"