Re: Detecting PDF files in a folder and sorting them by date
- From: Mike Willbanks <pencap@xxxxxxxxx>
- Date: Tue, 31 May 2005 12:55:53 -0500
Burnsy,
I am about to write an application that will display all pdf files in a folder and display them by file name in order of date.
Is there an easy way of doing this? I was thinking about somehow adding
filename and date created in an array, sorting by date and then
printing onto an html page with a link to that file. How would I do
this though? Is this the simplest method or is there a better way of
doin this?
I will not write the code for you but pretty much you have the idea right.
Read the directory, if you don't want to find mimetypes and just do it by extension find all files that have a .pdf.
Then when you find one of those files have the array do something like:
$arr[file_date_here] = ['name']. This however is not really expandable but will work.
Then you can sort by the index of the array and do a simple foreach as key value.
Mike
.
- References:
- Detecting PDF files in a folder and sorting them by date
- From: bissatch
- Detecting PDF files in a folder and sorting them by date
- Prev by Date: Re: Detecting PDF files in a folder and sorting them by date
- Next by Date: Re: mail() different php4 <-> php5
- Previous by thread: Re: Detecting PDF files in a folder and sorting them by date
- Next by thread: Track user usage, session tracking or cookies?
- Index(es):
Relevant Pages
|