Current Location: Home> Function Categories> filetype

filetype

Get file type
Name:filetype
Category:File system
Programming Language:php
One-line Description:Returns the file type.

Definition and usage

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

If successful, 7 possible values ​​are returned. If it fails, return false.

Possible values:

  • fifo
  • char
  • dir
  • Block
  • link
  • file
  • unknown

Example

Example 1

 <?php
echo filetype ( "test.txt" ) ;
?>

Output:

 file

Example 2

 <?php
echo filetype ( "images" ) ;
?>

Output:

 dir

grammar

 filetype ( filename )
parameter describe
filename Required. Specify documents to be inspected.
Similar Functions
Popular Articles