UTF-8 problems PHP/MySQL

后端 未结 7 1207
隐瞒了意图╮
隐瞒了意图╮ 2020-12-05 12:08

I\'ve always used ISO-8859-1 encoding, but I\'m now going over to UTF-8.

Unfortunately I can\'t get it to work.

My MySQL DB is UTF-8, my PHP document is enco

7条回答
  •  执念已碎
    2020-12-05 12:16

    After connecting to db, run query SET NAMES UTF8

    $db = new db(...);
    $db->query('set name utf8');
    

    and add this tag to header

     
    

提交回复
热议问题