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');