Filesize() only works on filesystems, not through HTTP.
All you can do is continue to read from the "file" in $fd untill you get an feof()
and count how many bytes you read.
Oh, and then you only have the size of the html code. If you want to images too, you'll have parse the html code and read the images seperately.