ID: 19772 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Feature/Change Request Operating System: Windows XP Home PHP Version: 4.2.3 New Comment:
Well, you should do that with readdir() with incrementing a variable. Previous Comments: ------------------------------------------------------------------------ [2002-10-05 15:45:37] [EMAIL PROTECTED] I think it would be handy to have these 2 functions. The difference is that one would count files and the other counts directories, like you probably guessed it. For example, if you d'like to count files ending with php3 and directories, you would do this : --- //Opens a directory and counts files and folders in it $dir = opendir(string path); $files = count_files($dir, "php3"); $directories = count_directories($dir); closedir($dir); //Outputs the number of files and directories echo $files; echo "<br>"; echo $directories; --- If you d'like to count every files you would put nothing in the extension parameter I know there's a way to count files and directories but it would be a "shortcut" function. Thanks, PsykX (Sorry for my english...) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=19772&edit=1