load file with wildcard?

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
bredoteau
Forum Newbie
Posts: 18
Joined: Fri Apr 01, 2005 7:46 am

load file with wildcard?

Post by bredoteau »

Hi,

I need to read in files of which I dont know the exact filename.
They follow this format:


b+itemnumber+unknown_part+.jpg

So, I can identify each file by the itemnumber (there will be no two files with the
same itemnumber) but I dont know the full filename.

Is it possible in any way to retrieve the filename?
Or maybe the whole directory, I could retrieve it by hand then.


example:
getfullfilenameof(b123456*.jpg)
should result in:
b123456 Joplin CD red cover.jpg


Greets,
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

glob() may be of interest.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

Just to add to what Feyd has said...

http://ca3.php.net/fnmatch might also be of interest...
bredoteau
Forum Newbie
Posts: 18
Joined: Fri Apr 01, 2005 7:46 am

Post by bredoteau »

perfect, thanks!
Post Reply