php how to get web image size in kb?
getimagesize
only get the width and height.
and filesize
caused waring
.
$imgsize=filesize("http://static.adzerk.net/Advertisers/2564.jpg");
echo $imgsize;
Warning: filesize() [function.filesize]: stat failed for http://static.adzerk.net/Advertisers/2564.jpg
Is there any other way to get a web image size in kb?
Short of doing a complete HTTP request, there is no easy way:
You can likely utilize
cURL
however to send a lighterHEAD
request instead.