Posted by Mike Willbanks on 10/02/53 11:17
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
Navigation:
[Reply to this message]
|