一个warning导致整个网站乱码

来源:互联网 发布:九阴隐脉加成算法 编辑:程序博客网 时间:2024/04/28 15:51

php在调用taobao的判断的链接时候,

$url="http://ip.taobao.com/service/getIpInfo.php?ip=".$ip;
$iparr=json_decode(file_get_contents($url),TRUE);

下面的这句,会导致出现warning:
failed to open stream: HTTP request failed!....


又因为这个warning导致整个网站出现乱码(也可能模板收到牵连)


后面修改了php.ini,貌似就没出现乱码了


所以出现的warning尽量屏蔽

0 0