How to insert or get O isntead ...

I am working on a small website for my mom in php using mysql. I want to use pasted cities to spit out Google Maps.

The problem is that if you enter a city with a Swedish name, for example, Norrköping, Google will not give you a map. You must insert Norrkoping without umlauts.

Is there a way to change the encoding to get information or input it to remove points?

Same as Åå (store as Aa) and Ää (store as Aa).

Thank!

+5
source share
3 answers

Why not something like this?

$s = array('Å', 'å', 'Ö', 'ö');
$r = array('A', 'a', 'O', 'o');
$name = str_replace($s, $r, $name);

"svensk-o" "a" , ... , , , ? , , , , ...: -)

0

iconv.

echo iconv("utf-8","ascii//TRANSLIT","Norrköping");
+3
$string = iconv(mb_detect_encoding($string), "ASCII//TRANSLIT", $string);
echo $string;
0
source

All Articles