You may get the size of a file by sending a HEAD HTTP request to the server. This works OK for images, mp3's and some others (.php usually is not among them).
try this code:
$URL = "http://www.phpbuilder.com/images/new-logo.gif";
$URL_parts = parse_url($URL);
if(!isset($URL_parts['port'])) $URL_parts['port'] = 80;
$s = fsockopen($URL_parts['host'], $URL_parts['port']) or die("Can't connect");
fputs($s, "HEAD ".$URL_parts['path']." HTTP/1.0\n");
fputs($s, "Host: ".$URL_parts['host']."\n");
fputs($s, "\n");
$HDR = '';
while(false !== ($resp = fgets($s, 1024))) $HDR .= $resp;
fclose($s);
$preg = '/Content-Length: ([0-9]+)/i';
if(preg_match($preg, $HDR, $mtch))
echo "Filesize: ".$mtch[1];
else echo "Filesize unknown.\nHeaders received:\n".$HDR;