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.

Example

Example 1

 <span class="token php language-php"><span class="token delimiter important"><?php</span>
<span class="token keyword">echo</span> <span class="token function">filetype</span> <span class="token punctuation">(</span> <span class="token string double-quoted-string">"test.txt"</span> <span class="token punctuation">)</span> <span class="token punctuation">;</span>
<span class="token delimiter important">?></span></span>

Output:

 file

Example 2

 <span class="token php language-php"><span class="token delimiter important"><?php</span>
<span class="token keyword">echo</span> <span class="token function">filetype</span> <span class="token punctuation">(</span> <span class="token string double-quoted-string">"images"</span> <span class="token punctuation">)</span> <span class="token punctuation">;</span>
<span class="token delimiter important">?></span></span>

Output:

 dir
Similar Functions
  • Create a temporary file tmpfile

    tmpfile

    Createatemporaryfile
  • Copy the file copy

    copy

    Copythefile
  • Create a file with a unique file name tempnam

    tempnam

    Createafilewithauniq
  • Provide information about the document stat

    stat

    Provideinformationab
  • alias for fwrite fputs

    fputs

    aliasforfwrite
  • Determine whether the file is uploaded through HTTP POST is_uploaded_file

    is_uploaded_file

    Determinewhetherthef
  • Read a line from the file pointer and parse the CSV field fgetcsv

    fgetcsv

    Readalinefromthefile
  • Synchronize changes to files (including metadata) fsync

    fsync

    Synchronizechangesto