I’m trying to count all files within a folder. This is the code I’m using:
<?php
$dir = new DirectoryIterator("myfolder/mysubdolder");
foreach($dir as $file ){ $x += (isImage($file)) ? 1 : 0;}
?>
It returns this error:
Fatal error: Call to undefined function isImage() in C:…
What’s wroing with my code?
Thanks
Uli
Try this:
have a look here: http://www.php.net/manual/en/directoryiterator.isfile.php