0

嗨,我正在使用下面的代码来检查远程图像的大小。它可以工作,但是检查图像的大小需要很多时间是否有更好的方法可以做

<?php
  $url='http://testfile.com/test/sddkssk.jpg';
  $head = array_change_key_case(get_headers($url, TRUE));
  $filesize = $head['content-length'];
  if ($filesize >= 131000) {     
    echo 'good image';
  }

但是每次加载需要 2-3 分钟有没有更好的方法可以非常快速地完成相同的工作

4

1 回答 1

0
$size = getimagesize("http://www.example.com/gifs/logo.gif");

// if the file name has space in it, encode it properly
$size = getimagesize("http://www.example.com/gifs/lo%20go.gif");
于 2013-12-20T16:03:25.227 回答