I'm trying to get this to count how many matches there are. I'm not having any luck . Any ideas?
<?
global $value;
global $counted_matches;
$i = 0;
if ($dir = @opendir("c:\")) {
while (($file = readdir($dir)) !== false) {
$value[$i] = $file;
$i = $i+1;
}
closedir($dir);
}
foreach ($value as $moo) {
if(eregi('.*.sys$', $moo, $matches[$i])) {
echo $matches[$i][0]."<BR>";
}
$counted_files =count($matches);
if ($matches == 0)
{ echo "No results"; }
}
echo "Values: ".count($value);
echo "Files:".$counted_files;
?>