how to get the list of all (.xls) files in a 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
User avatar
susrisha
Forum Contributor
Posts: 439
Joined: Thu Aug 07, 2008 11:43 pm
Location: Hyderabad India

how to get the list of all (.xls) files in a folder

Post by susrisha »

I am using the function scandir to get the list of all the files in a folder.

My problem is to get only the files which are excel format.
is there any function that returns the array of file names of given extension in a directory?
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: how to get the list of all (.xls) files in a folder

Post by VladSun »

Use glob()
There are 10 types of people in this world, those who understand binary and those who don't
Post Reply