English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The filesize() function can return the size of the specified file. If successful, this function can return the file size (in bytes), if failed, it returns false.
int filesize ( string $filename )
If an error occurs, this function can return the file size (in bytes) or false (and can generate an E_WARNING level error).
<?php $filename = "sample.txt"; echo $filename . ': ' . filesize($filename) . ' bytes'; ?>Test see if‹/›
Output result
sample.txt: 27 byte