The difference between is_file and file_exist in php is that in PHP, is_file and file_isexist have very common areas. 1) is_file: & nbsp; $ path = "/path/to/file/text.txt"; & nbsp; if (file_exists ($ path) & nbsp; & n differences between is_file and file_exist in php
In PHP, is_file and file_isexist have very small cells.
1) is_file:
$ Path = "/path/to/file/text.txt ";
If (file_exists ($ path ))
Echo "File Exists ";
Else
Echo "File not Exists ";
For example, in this example, if a file exists, true is returned, and false is returned if no object exists.
The correct path (such as a file directory) also returns true:
$ Path = "/path/to/file ";
2) file_isexist ()
This won't happen. it is really to judge whether a file exists. if the above one is passed in, although it looks like
The correct path also returns false. The first floor is liuzhiqiangruc, and the directory is also file.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service