You are here: Re: Detecting PDF files in a folder and sorting them by date « PHP Programming Language « IT news, forums, messages
Re: Detecting PDF files in a folder and sorting them by date

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация