is_dir
Determine whether the given file name is a directory
is_dir()
function checks whether the specified file is a directory.
<?php $file = "images"; if(is_dir($file)) { echo ("$file is a directory"); } else { echo ("$file is not a directory"); } ?>
输出:
images is a directory
is_dir ( file )
parameter | describe |
---|---|
file | Required. Specify documents to be inspected. |
Returns true if the file name exists and is a directory. If the file is a relative path, check its relative path according to the current working directory.