For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > May 2006 > CountDir?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author CountDir?
Lajos

2006-05-08, 3:58 am

Hi,
Is there a way to count the number of existing dirictories in a given
directory?
thnx Lajos
Janwillem Borleffs

2006-05-08, 6:59 pm

Lajos wrote:
> Is there a way to count the number of existing dirictories in a given
> directory?
>


When the PHP version you've installed supports the glob function, you
can simply do:

$num_dirs = count(glob('*', GLOB_ONLYDIR));


JW



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com