Replace worldwide diacritics

Possible duplicate:
PHP: replace umlauts with the nearest 7-bit ASCII equivalent in a UTF-8 string

I want to replace the diacritical characters with his brother without diacritics. Example: from "guľôčka" I want to get "gulocka"

Is there any native function?

I was looking for a list of all diacritical characters around the world to replace str_replace. I can not find him.

Many thanks.

+2
source share
1 answer

You can achieve this by using iconv available in PHP and requesting encoding conversion using transliteration , (It really works for many different scripts!) If you want only basic European characters, make target Latin-1 or even ASCII.

On the page :

 iconv("UTF-8", "ISO-8859-1//TRANSLIT", $text) 
+1
source

Source: https://habr.com/ru/post/892157/


All Articles