note 48346 added to function.filesize
| From: | nobody6 at telenet dot be | Date: | Mon, 20 Dec 2004 11:52:06 +0000 |
| Subject: | note 48346 added to function.filesize | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-82078@lists.php.net to get a copy of this message | ||
For getting the file size of a extern file:
<?php
function get_size($page){
$file=str_replace('\"','"',file_get_contents($page));
$handle=fopen('tmp.dat', "w");
fwrite($handle, $file);
fclose($handle);
$size=filesize('tmp.dat');
unlink('tmp.day');
return $size;
}
$size=get_size('http://www.google.com');
?>
Its open the file, writes his source into a new file on the server. and gets the filesize of that
file and delete it.
----
Manual Page -- http://www.php.net/manual/en/function.filesize.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+48346
Delete -- http://master.php.net/manage/user-notes.php?action=delete+48346&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+48346&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+48346&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+48346&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+48346&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+48346&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+48346&report=yes
Search -- http://master.php.net/manage/user-notes.php