Home>Article>Backend Development> How to use php filetype function

How to use php filetype function

藏色散人
藏色散人 Original
2019-05-26 16:16:13 3343browse

php The filetype function is used to return the type of the specified file or directory. Its syntax is filetype(filename). If successful, the function returns one of 7 possible values; if it fails, it returns FALSE.

How to use php filetype function

#How to use php filetype function?

Definition and usage

The filetype() function returns the type of the specified file or directory.

If successful, this function returns one of 7 possible values. On failure, returns FALSE.

Possible return values:

fifo char dir block link file unknown

Syntax

filetype(filename)

Parameters

filename required. Specifies the documents to be checked.

Tips and Notes

Note: The results of this function will be cached. Please use clearstatcache() to clear the cache.

Example 1

The above code will output:

file

Example 2

The above code will output:

dir

The above is the detailed content of How to use php filetype function. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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