The filzesize()
function is a built-in function in PHP.
The following is the function prototype:
filesize(filename)
The filesize()
function obtains the size of a file in bytes. The name of the file in question is passed as the input argument to the function.
The filesize()
function takes the following input parameters:
filename
: A string that represents the name of the file.The function returns the size of the file in bytes in case of successful execution. The function returns False
in case of failure.
<?phpecho "File size: ";echo filesize("Edpresso.txt");?>
Here, we create a text file by the name Edpresso.txt.
This file is passed to the filesize()
function and the size returned by the function is displayed.
Free Resources