The is_dir() function in PHP allows users to check whether a file is a directory. It returns true if the file is a directory. However, the addresses provided must be RELATIVE TO THE CURRENT DIRECTORY. Suppose we have a directory structure as follows:

cwd
|-- dir1
  |-- dir2
     |-- dir3

where cwd is the current working directory

is_dir(dir1);  // returns true
is_dir(dir2);  // returns false
is_dir(dir1/dir2);  // returns true