When you define the remote file�s size its potential size plays an important role.
We can point at the following tasks of the remote file�s size defining:
1. Defining the size of the small file (html, php etc)
2. Defining the size of the large file (zip, rar, mp3 etc)
Defining the size of the small file

= "http://www.webobzor.net/index.php";
$fh = fopen($filename, "r");
$str = fread($fh, 1024)) != null) $fsize += strlen($str);

"File size: ".$fsize;

Open the $filename file, read the fread data till that data isn�t equal null. Define the length of the received strlen data and their sum $fsize.
Defining the size of the large file
As you could understand we can�t use the listed above method for defining large files. We use another method based on the tags reading.

function fsize($path)
$fp = fopen($path,"r");
$inf = stream_get_meta_data($fp);
$inf["wrapper_data"] as $v)
if (
$v = explode(":",$v);

$filesize = "http://www.res.goldpages.com.ru/downloads/icons/karbon.zip";

In that situation meta tags data are read, not file data. Here stream_get_meta_data function returns the data array that contains the information about file including the file size value:
HTTP/1.1 200 OK
Date: Fri, 20 Oct 2006 09:31:16 GMT
Server: Apache/1.3.37 (Unix) FrontPage/ PHP/4.4.4 with Suhosin-Patch mod_ssl/2.8.28 OpenSSL/0.9.7d-p1
Last-Modified: Thu, 12 Oct 2006 15:07:41 GMT
ETag: "61a0dc-54779-452e5a3d"
Accept-Ranges: bytes
Content-Length: 345977
Connection: close