note 15129 added to function.str-replace
| From: | fdqps at alfaproject dot com | Date: | Wed, 29 Aug 2001 07:55:31 +0000 |
| Subject: | note 15129 added to function.str-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-17290@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
http://www.php.net/manual/en/function.str-replace.php