What function can be used to check the size of a file in PHP?

To check the size of a file in PHP, you can use the `filesize()` function. This function returns the size of the file in bytes. By using `filesize()`, you can easily determine the size of a file and perform actions based on that information.

$file = 'example.txt';
$fileSize = filesize($file);

echo "The size of $file is: $fileSize bytes";