Script to check the size of your webpage/image
Code (php)
-
-
<?
-
function check_url_size($url){
-
-
$head = "";
-
-
-
$host = $url_p["host"];
-
-
$path = $url_p["path"];
-
-
-
if(!$fp)
-
-
{ return false; }
-
-
else
-
-
{
-
-
-
-
-
$headers = "";
-
-
-
-
}
-
-
}
-
-
-
$return = false;
-
-
-
foreach($arr_headers as $header) {
-
-
$s = "Content-Length: ";
-
-
-
-
break;
-
-
}
-
-
}
-
-
return $return;
-
-
}
-
-
//File size of Google Image
-
-
$size = check_url_size(‘http://www.google.com/images/logo_sm.gif’);
-
-
echo "Google Small Image Size is: $size bytes";
-
?>
-
