search for a file containing...xxx
Posted: Sun Apr 20, 2008 3:07 pm
hi,
i was hoping someone could help me out,
basically i am writing numerous files into a directory,these files are named and grouped similarly to this:
ref4949494_5.html
ref4949494_9.html
ref4949494_3.html
ref676766_5.html
ref676766_27.html
ref676766_3.html
basically the only static part of the filename is the reference number and the extension....the underscore number is completely random. Therefore i cannot easily tell how many files grouped by reference number there are, and what there exact filename is.
At the moment I cannot reference these entries in a corresponding database table, which would make it easy to reference by number etc.
So I am trying to find a way to do a filename search, from looking at my problem I am thinking some of my solution would use php substr, as well as regular expressions....
I would be extremely grateful if anybody could post a tip or a link to a tip, I have tried a google search but nothing helpful has come up.
i was hoping someone could help me out,
basically i am writing numerous files into a directory,these files are named and grouped similarly to this:
ref4949494_5.html
ref4949494_9.html
ref4949494_3.html
ref676766_5.html
ref676766_27.html
ref676766_3.html
basically the only static part of the filename is the reference number and the extension....the underscore number is completely random. Therefore i cannot easily tell how many files grouped by reference number there are, and what there exact filename is.
At the moment I cannot reference these entries in a corresponding database table, which would make it easy to reference by number etc.
So I am trying to find a way to do a filename search, from looking at my problem I am thinking some of my solution would use php substr, as well as regular expressions....
I would be extremely grateful if anybody could post a tip or a link to a tip, I have tried a google search but nothing helpful has come up.