13 gru 2008

Ilość plików w poszczególnych katalogach galerii

define ('PATH_IMAGE_GALERIA', PATH_IMAGE . 'galeria/');
foreach (glob(PATH_IMAGE_GALERIA.'*', GLOB_ONLYDIR) as $filename) {
$galeria_folder = substr(strrchr($filename, '/'), 1 );
$galeria_strony[$galeria_folder] = count(glob($filename . "/*.*"));
}
$dump = print_r($galeria_strony, true);
echo nl2br($dump);

Array
(
[php] => 4
[css] => 0
[javascript] => 0
[html] => 0
[http] => 1
[vba] => 0
[vbscript] => 1
)