php how to get web image size in kb?
getimagesize only get the width and height.
getimagesize
and filesize caused waring.
filesize
waring
You can get the file size by using the get_headers() function. Use below code:
$image = get_headers($url, 1); $bytes = $image["Content-Length"]; $mb = $bytes/(1024 * 1024); echo number_format($mb,2) . " MB";