I can find how to read a directory, but I can't figure this out.
How can I count the number of total files found in a directory?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled</title> </head> <body> <? if ($handle = opendir('directory_to_count')) { $i = 0; while (false !== ($file = readdir($handle))) { $i++; } echo "There are " . $i . " files in this directory"; closedir($handle); } ?> </body> </html>