Jump to content

Counting the amount of directories in a directory?


sw0o0sh

Recommended Posts

Is there a way to do this simply in one line?

 

For example,

 

$sp="dir/";
$totalcontents = count(glob($sp . "*"));

 

would return the amount of files AND directories combined in a specific directory. But how could I limit this to directories only?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.