PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
| <?php echo "<table><tr><td class=\"newstext\">naam</td><td class=\"newstext\">aantal</td></tr>"; if ($handle = opendir('foto')) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { echo "<tr><td class=\"newstext\"><a href=\"foto/$file\">$file</a></td>"; } } $map = opendir($file); // De map while($b = readdir($map)) { if(!is_dir($b) && $b != "." && $b != "..") { $i++; } } echo "<td class=\"newstext\">$i aantal plaatjes.</td></tr>"; $i = 0; closedir($handle); } ?> |
waarom telt hij hier niet het aantal bestanden per file? Als ik ipv opendir('foto') invul telt hij wel alle bestanden in de dir foto, maar hij moet juist de bestanden gaan tellen in de subdirs van foto, en dan wel zoiets:
chick 1 - 12 fotos
chick 2 - 13 fotos
enz.
de dir structuur kan er dan zo uitzien: foto/chick1/ en foto/chick2
Iemand een idee?