File_exists-Check whether a file or directory exists
File_exists
(PHP 4, PHP 5)
File_exists-Check whether a file or directory exists
Describe
Boolean file_exists (string $ file name)
Check to see if a file or directory exists.
Parameters
Filename
Path to a file or directory.
In Windows, use the//Computer name/share/file name or computer name to share the file name to check for files on the network share.
return value
Returns true if the filename of the specified file or directory exists; Except for false.
Note: This feature returns false for a symbolic link to a file that does not exist.
Warning
This feature returns false files because of the inability to enter Safe mode restrictions. But these files can also contain if they are located in Safe_mode_include_dir.
Note: The check is not valid using the real uid/gid.
Instance
For example # 1 Test if the file exists
$filename = '/path/to/foo.txt ';
if (file_exists ($filename)) {
echo "The file $filename exists";
} else {
echo "The file $filename does not exist";
}
?>
http://www.bkjia.com/PHPjc/445479.html www.bkjia.com true http://www.bkjia.com/PHPjc/445479.html techarticle file_exists-Check whether a file or directory exists file_exists (PHP 4, PHP 5) file_exists-Check whether a file or directory exists that describes Boolean file_exists (string $ file name) ...