php is_file() function


  Translation results:

英[faɪl]  美[faɪl]  

vt. File (divorce proceedings or other lawsuits); file...; file; publish and send to the newspaper

vi. Send (report to the newspaper); walk in a line; make an application

n. File; file (folder); column; file

Third person singular: files Plural: files Present participle: filing past tense: filed past participle: filed

php is_file() functionsyntax

How to use the is_file() function?

php is_file() function is used to determine whether the given file name is a normal file. The syntax is bool is_file (string $filename). If the file exists and is a normal file, it returns TRUE. Otherwise return FALSE.

Function: Judge whether the given file name is a normal file

Syntax: bool is_file (string $filename)

Parameters:

ParametersDescription
filenameRequired, the path of the file.

Description: If the file exists and is a normal file, return TRUE, otherwise return FALSE.

php is_file() functionexample

<?php
var_dump(is_file('a_file.txt'));
echo "<br>";
var_dump(is_file('/usr/bin/'));
?>

Run instance»

Click the "Run instance" button to view the online instance

Output:

bool(false)
bool(false)

Home

Videos

Q&A