How do I count the directory's files?

posted by iup85 on 2009-06-25 00:00:00
HI!
How do I count the directory's files in php?
dail avatar
dail
12
$images = glob('./img/*.jpg');
echo count($images);
To see the names of the files:
 
foreach($images as $img)
     echo basename($img).'<br />';
 
49 answers - 0 questions
+ 2  Positive        Negative

iup85
0
Thank you so much!
4 answers - 6 questions
  Positive        Negative



Answer the question



Top Users
  • dail (12)
  • livin52 (3)
  • camu (3)
  • softweb (2)
  • Nadine (1)
  • Josware (1)
  • lfelipecr (1)
  • gregoriohc (1)
  • Mitu (1)
  • ryan714 (1)