What is the difference between file_exists and is_readable in PHP?

The main difference between `file_exists` and `is_readable` in PHP is that `file_exists` checks if a file or directory exists at the specified path, while `is_readable` checks if a file exists and is readable. Therefore, `file_exists` will return true for both files and directories, while `is_readable` will only return true for files that are readable.

// Check if a file exists and is readable
$file_path = 'example.txt';

if (file_exists($file_path) && is_readable($file_path)) {
    echo "File exists and is readable.";
} else {
    echo "File does not exist or is not readable.";
}