PHP.nl

is_file

is_file

Tells whether the filename is a regular file

bool **is_file** string $filename

Tells whether the given file is a regular file. If is a symbolic link, it will resolve the symlink and will give information about the referred file. filename

filenamePath to the file.

Returns true if the filename exists and is a regular file, false otherwise.

Voorbeeld: example

<?php
var_dump(is_file('a_file.txt')) . "\n";
var_dump(is_file('/usr/bin/')) . "\n";
?>
bool(true)
bool(false)

is_dir``is_link``SplFileInfo