Return human readable file sizes.
Access
public
Parameters
Parameter |
Type |
Required |
Description |
---|---|---|---|
|
Required |
Filesize in bytes. |
|
|
Optional |
The maximum unit to use. Defaults to the largest appropriate unit. |
|
|
Optional |
The format for the return string. Defaults to |
Returns
Type |
Description |
---|---|
The human-readable file size. |
Examples
Convert a number of bytes into a human-readable format.
// Instantiate $s3 = new AmazonS3(); // Test data var_dump($s3->util->size_readable(9876543210));Result:
string(7) "9.20 GB"
See Also
Source
Method defined in utilities/utilities.class.php | Toggle source view (30 lines) | View on GitHub