Um. I read it over.
So, this will open all the files:
<?php
if ($handle = opendir('/path/to/files')) {
echo "Directory handle: $handle\n";
echo "Files:\n";
/* This is the correct way to loop over the directory. */
while (false !== ($file = readdir($handle))) {
echo "$file\n";
}
/* This is the WRONG way to loop over the directory. */
while ($file = readdir($handle)) {
echo "$file\n";
}
closedir($handle);
}
?>
Then this is my counting script.
$cont = join('', file("$file"));
$count = substr_count($cont, '|');
print floor($count);
Would I just make it $file?
How do I connect the two?