file_get_contents乱码
<?php
//php文件要为utf8
header("Content-Type:text/html;charset=utf-8");//声明头部
$text=file_get_contents("http://dwz.cn/Rxa1PF1F");
$text = iconv("gb2312", "utf-8//IGNORE",$text);//主要是这个转文字
var_dump($text);
?>
码字很辛苦,转载请注明来自感触life-博客的《file_get_contents乱码》
2018-08-16
默认分类
评论