size (function)

Last updated: Tue, Jan 3, 2023 11:15 am
Return to Knowledgebase

Purpose

Returns the size of a file

Location

users/helpers/helpers.php

Version Information

First Introduced v2.5.0

Parameters

# Parameter Data Type Required Description
1 $path string Yes The path of the file whose size you want to calculate

Returns

Data Type Description of Returned Data
string Returns the size of a file in a format such as 586 B, 102 KB, or 2 MB.

Example

echo size($abs_us_root . $us_url_root . 'z_us_root.php');