search

Home  >  Q&A  >  body text

php乱码的问题?

加入header("content-type:text/html; charset=utf-8");

页面展示的效果没有出现乱码,但是数据库查询就乱了,有什么好的解决方法?


看透不说透看透不说透2985 days ago1148

reply all(2)I'll reply

  • 数据分析师

    数据分析师2017-09-30 22:45:53

    php garbled problem? -PHP Chinese website Q&A-php garbled problem? -PHP Chinese website Q&A

    Please watch and learn.

    reply
    0
  • 迷茫

    迷茫2016-12-17 15:05:27

    查询数据库指定编码

    $link = mysqli_connect('localhost','root','密码','数据库名') ;
    $link->query("SET NAMES utf8");

    这样即可,也可设置数据库的编码!

    reply
    2
  • Cancelreply