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
Group MySQL results by ID for looping over
I have a table with flight data in mysql. I'm writing a php code that will group and displ...
From 2024-04-06 17:27:56
0
1
406
Related Topics
More>
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
|