Thursday, August 6, 2009

Replace Character Codes using PHP.

How to replace character codes for german using str_replace php function. Characters such as :

ä
Ä'
é
ö
Ö
ü
Ü
Other chars.

see simple example.

 <?php
$find ="ü";
$rep = "u";
$str = "aüstin";
echo str_replace($find,$rep,utf8_encode($str));
?>