PHP replacing special characters like à->a, è->e

前端 未结 8 1778
隐瞒了意图╮
隐瞒了意图╮ 2020-11-27 14:20

I have php document signup.php which save the content from form (in form.php document) to MySQL base. The problem arises when I want to reformat the input content. I want do

8条回答
  •  佛祖请我去吃肉
    2020-11-27 14:58

    CodeIgniter way:

    $this->load->helper('text');
    
    $string = convert_accented_characters($string);
    

    This function uses a companion config file application/config/foreign_chars.php to define the to and from array for transliteration.

    https://www.codeigniter.com/user_guide/helpers/text_helper.html#ascii_to_entities

提交回复
热议问题