Definition :
The PHP filetype() function returns the type of the specified file.
Note: The results of this function are cached. Use clearstatcache() function to clear the cache.
Possible return values:
filetype(filename)
Parameter | Description |
---|---|
filename | Required. Specifies the file to check |
Given below example Return the file type for "demo.txt":
Output : file type: file
file type: dir
file type: dir