Can anyone please help me exclude the .php files from this code?
<?php
$dir = 'x';
$filecount = 0;
$d = dir($dir);
while ($f = $d->read()) {
if(($f!= ".") && ($f!= "..")) {
if(!is_dir($f)) $filecount++;
}
}
echo 'there are ',$filecount,' files in this folder';
?>
I have tried to use ereg function but had no luck :(
ereg('\.php', $f)