1. Case:
Copy code The code is as follows:
$file = ' jb51.net.php';
if (is_readable($file) == false) {
die('The file does not exist or cannot be read');
} else {
echo 'Exists ';
}
?>
is_readable() function determines whether the specified file name is readable.
The specified file or directory exists and is readable, then TRUE is returned
2. Case:
Copy code The code is as follows:
$filename = 'jb51.net.php';
if (file_exists($filename)) {
echo "The file $filename exists";
} else {
echo "The file $filename does not exist";
}
?>
file_exists -- Check whether the file or directory exists
Description
bool file_exists ( string filename )
If by filename Returns TRUE if the specified file or directory exists, otherwise returns FALSE.
3. Case:
Copy code The code is as follows:
$file = 'jb51.net.php';
if (is_file($file) == false) {
die('The file does not exist or cannot be read');
} else {
echo 'exists';
}
?>
is_file -- Determine whether the given file name is a normal File
Description
bool is_file (string filename)
Returns TRUE if the file exists and is a normal file.
http://www.bkjia.com/PHPjc/326102.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/326102.htmlTechArticle1. Case: Copy the code as follows: ?php $file = 'jb51.net.php'; if ( is_readable($file) == false) { die('The file does not exist or cannot be read'); } else { echo 'exists'; } ? is_read...