$file = 'example.txt'; if (isReadable($file)) { echo 'The file is readable.'; } else { echo 'The file is not readable.'; }
$file = 'example.txt'; if (file_exists($file)) { if (isReadable($file)) { echo 'The file is readable.'; } else { echo 'The file is not readable.'; } } else { echo 'The file does not exist.'; }Package/library: The `isReadable()` function is a core PHP function and does not require any external package or library.