note 30366 deleted from function.str-replace by alindeman
| From: | alindeman@php.net | Date: | Sat, 17 May 2003 22:09:01 +0000 |
| Subject: | note 30366 deleted from function.str-replace by alindeman | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-48292@lists.php.net to get a copy of this message | ||
Note Submitter: euler@free.fr
----
One of the contributor said that strtr was faster than str_replace, which is right, except that
strtr CANNOT remove characters from a string !
In the above example:
$str = '192.168.0.75';
$str = strtr($str,'.',"");
echo $str;
outputs: 192.168.0.75
$str = '192.168.0.75';
$str = str_replace('.',"",$str);
echo $str;
outputs: 192168075