How to get file size in PHP

The filesize() function returns the size of the specified file. This function returns the file size in bytes on success or FALSE on failure with check below code. You may also like How to get file sizes KB, MB & GB using PHP and How to convert bytes Into KB, MB and GB using PHP.

Code

$filw_size =  filesize('demo.pdf'); 

Leave a Reply

Your email address will not be published. Required fields are marked *