note 15129 deleted from function.str-replace by philip
| From: | philip@php.net | Date: | Fri, 11 Oct 2002 18:55:49 +0000 |
| Subject: | note 15129 deleted from function.str-replace by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-37952@lists.php.net to get a copy of this message | ||
For those people who want to do an array "search and replace" and have not yet upgraded to
4.0.5 this litle script might help.
When you update you will only have to remove the "for" stuff and it will be 4.0.x native
;-)
_______________________________________
$swe_from =
array("Ã¥","ä","ö","Ã
","Ã","Ã");
$swe_to = array("å", "ä", "ö", "Å", "Ä",
"Ö");
for ($i=0; $i<count($swe_from); $i++)
{
$fname = str_replace ($swe_from[$i], $swe_to[$i], $fname);
}
_______________________________________
Best regards
Fredrik Davidsson