$fileSize = filesize('example.txt'); echo $fileSize;
$filePath = '/home/user/documents/myfile.pdf'; $fileSize = filesize($filePath); echo $fileSize;The `getSize()` function is a built-in function in PHP, therefore no separate package library is required.