Current Location: Home> Function Categories> is_dir

is_dir

Determine whether the given file name is a directory
Name:is_dir
Category:File system
Programming Language:php
One-line Description:Determines whether the specified file name is a directory.

Definition and usage

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

grammar

 is_dir ( file )
parameter describe
file Required. Specify documents to be inspected.

illustrate

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.

Similar Functions