counting number of files in folder

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kkonline
Forum Contributor
Posts: 251
Joined: Thu Aug 16, 2007 12:54 am

counting number of files in folder

Post by kkonline »

I want to count the number of html files present in a folder; and then display the resulting number; how can i do this; is there any inbuilt php function or command?
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Re: counting number of files in folder

Post by RobertGonzalez »

count() and glob(). Read the manual on those two functions to see how they can be easily used to give you what you want.
Post Reply