PHP.nl

filetype

filetype

Gets file type

 **filetype** string $filename

Returns the type of the given file.

filenamePath to the file.

Returns the type of the file. Possible values are fifo, char, dir, block, link, file, socket and unknown.

Returns false if an error occurs. will also produce an message if the stat call fails or if the file type is unknown. filetype``E_NOTICE

Voorbeeld: example

<?php

echo filetype('/etc/passwd');
echo "\n";
echo filetype('/etc/');

?>
file
dir

is_dir``is_file``is_link``file_exists``mime_content_type``pathinfo``stat