Get the count of sub-folders
<p>I was using <code>count(glob("test/*"))</code> to count the sub-folders in the <code>test</code> folder, but now that I also have files in the <code>test</code> folder, not just folders, I get incorrect results. Is there a way to modify the <code>glob</code> pattern so that it'll return only the folders, not files?</p>

<p>I've thought about a workaround. Get the total count of folders and files, get the count of files only, and then, subtract the count of files from the count of the whole.</p>

<pre><code>$total_items  = count(glob("test/*"));
$total_files  = count(glob("test/*.*"));
$folder_count = $total_items - $total_files;
</code></pre>

<p>This works, but there might be a simpler way to do this.</p>