PHP关于GetImageSize 判断网络图片类型问题
本帖最后由 ciscole 于 2013-09-02 14:39:26 编辑
$data = GetImageSize($logoUrl);
if $data[2] =='1' {
$logo = ImageCreateFromGIF($logoUrl);
}
else if $data[2] =='2' {
$logo = ImageCreateFromJPEG($logoUrl);
}
else {
$logo = ImageCreateFromPNG($logoUrl);
}
if($s = file_get_contents($logoUrl)) {
$logo = imagecreatefromstring($s);