AndrewFerrara Posted January 28, 2011 Share Posted January 28, 2011 Displaying the number of files in a directory and its subdirectorys <?php $path = './images_cache'; if ($handle = opendir($path)) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { $fName = $file; $file = $path.'/'.$file; if(is_file($file)) $numfile++; if(is_dir($file)) $numdir++; }; }; closedir($handle); }; echo $numfiles.' files in a directory'; echo $numdir.' subdirectory in directory'; ?> Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted January 28, 2011 Share Posted January 28, 2011 So, what's your question? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.