Try this.
$url=parse_url($urlcheck);
$host=$url["host"];
$path=$url["path"];
$fp = fsockopen($host, 80, &$errno, &$errstr, 20);
if(!$fp) {
echo("error");
exit ();
}
else {
fputs($fp,"HEAD $urlcheck HTTP/1.1\r\n");
fputs($fp,"HOST: dummy\r\n");
fputs($fp,"Connection: close\r\n\r\n");
while (!feof($fp)) {
$ourhead = sprintf("%s%s", $ourhead, fgets ($fp,128));
}
fclose ($fp);
print $ourhead; //just to see the head
Just pull out the Size from the $ourhead