Here is my PHP code:
<?php
// Enumerate the directories in styles
$styles_dir = 'styles/';
if($handle = opendir($styles_dir))
{
while(FALSE !== ($file = readdir($handle)))
{
echo $file . '(' . is_dir($file) . ')<br>';
}
}
?>
Here are the directories in styles:
http://files.quickmediasolutions.com/php.jpg
And here is the output:
.(1)
..(1)
forest()
industrial()
Why aren’t forest and industrial directories?
The path for
is_diris relative to the base file, so you really need to do a test likeNote that this is masked for the
.and..“directories” as these exist everywhere.