Re: FTP_SIZE()
| From: | Richard Lynch | Date: | Fri, 24 Nov 2000 19:23:37 +0000 |
| Subject: | Re: FTP_SIZE() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-27008@lists.php.net to get a copy of this message | ||
I probably got the numbers wrong, but do it like this:
$size = ftp_size(...);
if ($size >= 1000000000){
printf("%2.0fG", $size/1000000000);
}
elseif ($size >= 1000000){
printf("%2.0fM", $size/1000000);
}
elseif($size >= 1000){
printf("%2.0fK", $size/1000);
}
Actually, you probably should use 1024 for 1000 and similarly for larger
sizes.
----- Original Message -----
From: "Matt Lush" <mlush26@hotmail.com>
Newsgroups: php.general
Sent: Friday, November 24, 2000 11:44 AM
Subject: [PHP] FTP_SIZE()
I got a question I have got down using ftp_size () but is there anyway not
to have it in bytes like say if the file is beteween 100 - 1000 kb it would
print it as kb and if it was over that it would print it as mb is that
possible THX
MATT