I Need Help Count All Files In Directory
Started on the old forum in August 2007 · view the original in the archive · old links redirect here
ibro9801
#2
From wapbuddy script External image (may be gone)
<?php
if(!($dp = opendir("./"))) die ("Cannot open ./");
$file_array = array();
while ($file = readdir ($dp))
{
if(substr($file,0,1) != '.' and $file != "index.php" and $file != "search.php")
{
$file_array[] = $file;
}
}
$file_count = count ($file_array);
sort ($file_array);
echo "Files in this directory: $file_count";
?>
Guest
#3
From wapbuddy script External image (may be gone)
<?php if(!($dp = opendir("./"))) die ("Cannot open ./"); $file_array = array(); while ($file = readdir ($dp)) { if(substr($file,0,1) != '.' and $file != "index.php" and $file != "search.php") { $file_array[] = $file; } } $file_count = count ($file_array); sort ($file_array); echo "Files in this directory: $file_count"; ?>
sory!! this code not count subdirectory