Re: Counting files in directory and subdirectory!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



here is what I tried but it doesn't work! any advice suggestions or something?

$count = 0;
$dir = "/amrs";
$files1 = scandir($dir);
if ($files1 !== '.' && $files1 !== '..') {
foreach ($files1 as $files2){
$dir2 = "/amrs/$files2";
$files3 = scandir($dir2);
if ($files3 !== '.' && $files3 !== '..') {
foreach ($files3 as $files4){
$dir3 = "/amrs/$files2/$files4";
$files5 = scandir($dir3);
if ($files5 !== '.' && $files5 !== '..') {
foreach ($files5 as $files6){
$count++;
}
}
}
}
}
}
echo "$count";
~Nick Couloute
co-owner/Web Designer
Sidekick2Music.Com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux