file_exists Functions in PHP
This article is to explain the PHP in the judgment file or directory is the existence of the file_exists function, with a few classic examples, the need for small partners to refer to.
Description
BOOL File_exists (String $filename)
Returns TRUE if the file or directory specified by filename is present, otherwise FALSE.
On Windows, use the//Computer name/share/file name or computer name to share the file name to check for network shared files.
In Windows, you use//computername/share/filename or \\computername\share\filename to check for shared files on your network.
Instance One
?
1 2 3 4 5 6 7 8 |
$filename = '/jb51.net/aa/to/foo.txt '; if (file_exists ($filename)) { echo "File $filename exists"; } else { echo "File $filename does not exist"; } ?> |
The output is:
File/jb51.net/aa/to/foo.txt already exists
Example Two
?
1 2 3 |
Echo file_exists ("Jb51.net.txt"); ?> |
Use file_exists directly to return ture or false.
The above mentioned is the whole content of this article, I hope you can like.
Note < > : More Exciting tutorials please focus on helping the home program
http://www.bkjia.com/PHPjc/996755.html www.bkjia.com true http://www.bkjia.com/PHPjc/996755.html techarticle php file_exists function Use in detail this article is to explain the PHP file or directory to determine whether the existence of the file_exists function, with a few classic examples, the need for small partners can ...