Re: sorting files by date
| From: | Kim Steinhaug | Date: | Wed, 12 Nov 2003 12:07:50 +0000 |
| Subject: | Re: sorting files by date | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-169256@lists.php.net to get a copy of this message | ||
U wouldnt need to timestamp it, split the filename insert into 2 dimensional
array,
and use the sort() command and you have it.
Se examples her, theres also examples of sorting into more levels, meaning
you
can sort first by date, then by filename aslong as you do your splitting
right, :)
http://se.php.net/sort
Kim
"Justin French" <justin@indent.com.au> wrote in message
news:5CD18AF1-14AD-11D8-AB5D-000A9579CE3A@indent.com.au...
> Hi,
>
> I have a dir of files saved in the following format: YYYY-MM-DD.mp4. I
> know how to get the file names into an array, but I don't know how to
> sort the array so that the files appear in date order. My guess was to
> use strtotime() to get the date into a timestamp, then sort on the
> timestamp, but there MUST be an easier way :)
>
> I've read through most of the array part of the manual, but can't see
> what I need.
>
>
> Justin