Convert national chars into their latin equivalents in PHP

后端 未结 7 2095
日久生厌
日久生厌 2021-01-01 22:27

I need some strings that contain german chars converted to their latin equivalent. For example

\'Höhle\' => \'Hohle\'
7条回答
  •  梦毁少年i
    2021-01-01 23:08

    The easiest way to do that would be

    echo transliterator_transliterate('Any-Latin; Latin-ASCII', "Höhle"); // returns Hohle
    

提交回复
热议问题