Home > PHP > Function > Filesystem > is_dir()

is_dir()

is_dir - Tells whether the filename is a directory

Syntax

bool is_dir (string $filename)

Arguments

  • filename - Path to the file. If filename is a relative filename, it will be checked relative to the current working directory. If filename is a symbolic or hard link then the link will be resolved and checked. If you have enabled safe mode, or open_basedirfurther restrictions may apply.

Description

Tells whether the given filename is a directory.

Version

PHP 4, 5

Return value

Returns TRUE if the filename exists and is a directory, FALSE otherwise.