PHP代码中出现中文乱码怎么办?

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 '开发中...';
    }
}

 

posted @ 2018-03-06 17:23  php小小菜鸟  阅读(862)  评论(0编辑  收藏  举报