Get image, video, PDF (any file) size without file download from URL.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
$ch = curl_init('http://www.google.co.in/images/srpr/logo4w.png'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_HEADER, TRUE); curl_setopt($ch, CURLOPT_NOBODY, TRUE); $data = curl_exec($ch); $size = curl_getinfo($ch, CURLINFO_CONTENT_LENGTH_DOWNLOAD); curl_close($ch); echo $size; |
More Stories
CPU & Memory usage in PHP
Install PHP mcrypt extension on Ubuntu
Text to speech