Is there a string functions which replaces all the awkward characters, like
Hellö becomes Hello,
Or do i need the following strtr function, and put all the awkward characters in the...?
$addr = strtr($addr, "äåö", "aao");
Is there a string functions which replaces all the awkward characters, like
Hellö becomes Hello,
Or do i need the following strtr function, and put all the awkward characters in the...?
$addr = strtr($addr, "äåö", "aao");
I'm assuming by "awkward characters" you mean anything that is not ASCII. If so, then try iconv:
$addr = iconv('UTF-8', 'ASCII//TRANSLIT', $addr);
The first argument is the character set of the input string.
$addr = "Hellö";
echo $addr . "\n";
$addr = iconv('UTF-8', 'ASCII//TRANSLIT', $addr);
echo $addr . "\n";
Output
Hellö Hello
See it run at ideone.
?. However, is depend on OP environment setting.