<?php
$myFile = "index.html";
if (is_dir($myFile)) {
echo "That file is a directory";
} else {
echo "That file is NOT a directory";
}
?>
That file is NOT a directory
Let's run that same code on a folder to see what output we get.
<?php
$myFile = "images";
if (is_dir($myFile)) {
echo "That file is a directory";
} else {
echo "That file is NOT a directory";
}
?>
That file is a directory