Sun Mar 27, 2011 10:17 pm
// folder path end with '/'
function directoryListCount($folderPath) {
$num_files= 0;
$dirStream = opendir($folderPath);
if (!$dirStream) return -1;
while ($file = readdir($dirStream)) {
if ($file == '.' || $file == '..') continue;
if (is_dir($folderPath. $file)){
$num_files+= directoryListCount($folderPath. $file . DIRECTORY_SEPARATOR);
}
else {
$num_files++;
}
}
closedir($dirStream);
return $num_files;
}
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.