Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

is_file(3) [php man page]

IS_FILE(3)								 1								IS_FILE(3)

is_file - Tells whether the filename is a regular file

SYNOPSIS
bool is_file (string $filename) DESCRIPTION
Tells whether the given file is a regular file. PARAMETERS
o $filename - Path to the file. RETURN VALUES
Returns TRUE if the filename exists and is a regular file, FALSE otherwise. Note Because PHP's integer type is signed and many platforms use 32bit integers, some filesystem functions may return unexpected results for files which are larger than 2GB. EXAMPLES
Example #1 is_file(3) example <?php var_dump(is_file('a_file.txt')) . " "; var_dump(is_file('/usr/bin/')) . " "; ?> The above example will output: bool(true) bool(false) ERRORS
/EXCEPTIONS Upon failure, an E_WARNING is emitted. NOTES
Note The results of this function are cached. See clearstatcache(3) for more details. Tip As of PHP 5.0.0, this function can also be used with some URL wrappers. Refer to "Supported Protocols and Wrappers" to determine which wrappers support stat(3) family of functionality. SEE ALSO
is_dir(3), is_link(3). PHP Documentation Group IS_FILE(3)

Check Out this Related Man Page

IS_DIR(3)								 1								 IS_DIR(3)

is_dir - Tells whether the filename is a directory

SYNOPSIS
bool is_dir (string $filename) DESCRIPTION
Tells whether the given filename is a directory. PARAMETERS
o $filename - Path to the file. If $filename is a relative filename, it will be checked relative to the current working directory. If $file- name is a symbolic or hard link then the link will be resolved and checked. If you have enabled safe mode, or open_basedir further restrictions may apply. RETURN VALUES
Returns TRUE if the filename exists and is a directory, FALSE otherwise. EXAMPLES
Example #1 is_dir(3) example <?php var_dump(is_dir('a_file.txt')); var_dump(is_dir('bogus_dir/abc')); var_dump(is_dir('..')); //one dir up ?> The above example will output: bool(false) bool(false) bool(true) ERRORS
/EXCEPTIONS Upon failure, an E_WARNING is emitted. NOTES
Note The results of this function are cached. See clearstatcache(3) for more details. Tip As of PHP 5.0.0, this function can also be used with some URL wrappers. Refer to "Supported Protocols and Wrappers" to determine which wrappers support stat(3) family of functionality. SEE ALSO
chdir(3), dir(3), opendir(3), is_file(3), is_link(3). PHP Documentation Group IS_DIR(3)
Man Page