首页 > 技术文章 > PHP代码中出现中文乱码怎么办?

qichao123 2018-03-06 17:23 原文

header("Content-type:text/html;charset=utf-8"); //加上这个就OK

//示例 :
class WechatController extends Controller{
    //put your code here
    public function callback() {
        header("Content-type:text/html;charset=utf-8");
        echo '开发中...';
    }
}

 

推荐阅读