The is_dir() function checks whether a file is a directory. It returns TRUE if the directory is found.
Syntax
is_dir(file_path)
Parameters
file_path − Specify the path of the file.
Return
The is_dir() function returns TRUE if the directory is found.
Example
<?php
$check = "D:/tutorials";
if (is_dir($check))
echo ("Directory!");
else
echo ("Not a directory!");
?>Output
Not a directory!