Saturday March 23, 2019 - 11:24:19 AM

Registered Linux User #440901    

Login    Register
Login Required

PHP File Size Information

To get the size of a file with php use this function:

function filesize_readable($pathz)
$fsize = filesize($pathz);
$runits = array( 'B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
$mult = $fsize > 0 ? floor(log($fsize, 1024)) : 0;
return number_format($fsize / pow(1024, $mult), 2, '.', ',') . ' ' . $runits[$mult];
print("The file " . $thefile . " is " . filesize_readable($thefile));

The above function could be used in conjunction with the gzip function and/or included in your functions include file(s).

If you would like some information on how to do something use the Contact Page. Someone will get back with you with an answer.

“Windows - Just Say No”

Time since last reboot: 4 days, 4 hours, 44 minutes, 4 seconds

Page generated in zero point nine seven (0.97) seconds.

@ Active Member Project Honeypot  email addresses

This page was last modified on 12/21/18 @ 11:55:49:pm
This file name: info_php_filesize.php

Questions, Comments, Suggestions or Requests should be sent to: 

There have been  84460  Unique Visitors (IP Addresses) to this site.

Current users online : 13
Maximum users at a time : 50
Last 25 attacks have come from:

There are currently 25 unique IP addresses blacklisted.

Public Server Status
server offline limelight  web service
 Aw Crap!, It's Off-Line
server offline limelight  mail service
 Aw Crap!, It's Off-Line
server online www  web service
 Is On-Line
server online mx 08  mail service
 Is On-Line
server online www01  F/O web service
 Is On-Line
server online mx 09  mail service
 Is On-Line
server online tertiary  DNS service
 Is On-Line
server online mx 10  mail service
 Is On-Line

©Copyright 2004-2019 - - Redd Enterprises™, Inc.,  All Rights Reserved.
Ubuntu® is a registered trademark of Canonical Ltd.
Linux® is a registered trademark of Linus Torvalds.
Apache® is a registered trademark of The Apache Software Foundation.
PHP® is a registered trademark of The PHP Group.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
All other product and service names mentioned are the trademarks of their respective companies.


Let us know what you think!