PHP convert foreign characters with accents

后端 未结 5 1299
有刺的猬
有刺的猬 2020-12-16 08:03

Hi I\'m trying to compare some text to the text in a database.. in the database any text with an accent is encoded like in html (ie. é) when I compare the databas

5条回答
  •  北荒
    北荒 (楼主)
    2020-12-16 08:36

    Use simply as blow it works for Norwegian characters:

    function convert_accent($string)
    {
        return htmlspecialchars(utf8_decode($string));
    }
    

提交回复
热议问题