Forum Moderators: coopster

Message Too Old, No Replies

how do i count the number of files in a directory?

         

al1911

5:45 pm on Jan 31, 2005 (gmt 0)

10+ Year Member



i want to do this...

if ( number of files in directory >= 1 ) { do this; }
else { do something else }

any help appreciated

Zipper

6:08 pm on Jan 31, 2005 (gmt 0)

10+ Year Member




$dir_path = "/full/directory/path/";
$count = count(glob($dir_path . "*"));

if($count >= 1){
//step 1
} else {
//step 2
}