php filesize function is used to return the size of the specified file. Its syntax is filesize(filename). If successful, it returns the number of bytes of the file size. If it fails, false is returned and an E_WARNING level error is generated.
#How to use the php filesize function?
Definition and usage
filesize() function returns the size of the specified file.
If successful, return the number of bytes of the file size. On failure, returns false and generates an E_WARNING level error.
Syntax
filesize(filename)
Parameters
filename required. Specifies the documents to be checked.
Tips and comments
Tips: The results of this function will be cached. Please use clearstatcache() to clear the cache.
Example
<?php echo filesize("test.txt"); ?>
Output:
20
The above is the detailed content of How to use php filesize function. For more information, please follow other related articles on the PHP Chinese website!