Forum und email

filetype

(PHP 4, PHP 5)

filetype — Leest het type van een bestand uit

Beschrijving

string filetype ( string $filename )

Geeft het type van het bestand terug. Mogelijke waardes zijn fifo, char, dir, block, link, file en unknown.

Geeft FALSE terug in het geval van een fout. filetype() zal ook een E_NOTICE bericht produceren als de stats aanroep faalt of als het bestands type onbekend is.

Note: The results of this function are cached. See clearstatcache() for more details.

Note: This function will not work on remote files as the file to be examined must be accessible via the servers filesystem.

Example#1 filetype() voorbeeld

<?php

echo filetype('/etc/passwd');  // file
echo filetype('/etc/');        // dir

?>

Zie ook is_dir(), is_file(), is_link(), file_exists(), stat() en mime_content_type().