09-22-2007, 12:29 AM
|
#4 (permalink)
|
|
The Wanderer
Join Date: Sep 2007
Posts: 11
Thanks: 0
|
This is what you are talking about, at least this is what I can infer from your posts.
PHP Code:
function getSize ( $url )
{
if ( intval(phpversion()) < 5 )
die ( 'PHP5 Required' );
$headers = get_headers ( $url, 1 );
return $headers['Content-Length'];
}
echo getSize ( 'http://www.google.com/images/firefox/fox1.gif' );
You will need PHP5 in order for this function to operate, you can use a php4 replacement, you would have to find the function or write it yourself at http://php.net/get_headers in the comments section.
It gets the headers of the file, which does not download the file itself (this will make it faster than using file_get_contents
Was this what you had in mind?
|
|
|
|