程序代码:
$img="http://images1.fantong.com/attach/14/original/团购440260.jpg";
$imgtype=getimagesize($img);运行后报错:
Warning: getimagesize(http://images1.fantong.com/attach/14/original/团购440260.jpg) [function.getimagesize]: failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found in D:\wwwroot\tuanjiji\admin\site_jd_strat_get.php on line 81当没有这张图片的时候报错是可以理解的,但是为什么这张图片明明是有的,还会报错呢?请大家帮忙看看是什么原因,谢谢了!小弟感激不尽。急用!!
$img="http://images1.fantong.com/attach/14/original/团购440260.jpg";
$imgtype=getimagesize($img);运行后报错:
Warning: getimagesize(http://images1.fantong.com/attach/14/original/团购440260.jpg) [function.getimagesize]: failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found in D:\wwwroot\tuanjiji\admin\site_jd_strat_get.php on line 81当没有这张图片的时候报错是可以理解的,但是为什么这张图片明明是有的,还会报错呢?请大家帮忙看看是什么原因,谢谢了!小弟感激不尽。急用!!
$img = urlencode($img);
$imgtype=getimagesize($img);
$img = urlencode($img); 加上这一句也是不行的,还是报错,你可以在你机器上测试一下。很感谢给予回复。
rizhi
而他的网站只接受utf-8编码的url参数$img="http://images1.fantong.com/attach/14/original/团购440260.jpg";
$imgtype=getimagesize(iconv('gbk','utf-8',$img));
print_r($imgtype);Array
(
[0] => 440
[1] => 260
[2] => 2
[3] => width="440" height="260"
[bits] => 8
[channels] => 3
[mime] => image/jpeg
)