The is_file() function in PHP is used to determine whether a file exists. The usage method is also very simple. Friends who need it can For reference.
The is_file() function checks whether the specified file name is a normal file.
is_file — Tells whether the filename is a regular file
Usage:
bool is_file ( string $filename ) $file is a required parameter
Return TRUE if the file exists and is a normal file.
Let’s look at an example first:
?
2 3 4
|
var_dump(is_file('/usr/bin/')) . "n"; ?>
The above example will output: bool(true) bool(false)
Previous article:Header jump in php uses include to solve the problem of missing parameters_PHP tutorial
Next article:Application example of PHP file reading function, _PHP tutorial
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Latest Issues
When adding sublime3 to compile system php, use the PHP toolbox, cmd php -v is useless
From 1970-01-01 08:00:00
0
0
0
Related Topics
More>
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
|