Try using any of the sort functions:

sort
asort
arsort
ksort
krsort 
...

That should get you started. 

--
Ray

On Wed, 2003-10-01 at 07:18, Greg Wiley wrote:
> Apologies if this has been asked before but I couldn't find
> anything on google or any of the PHP code sites that quite fits my
> requirements. Here's the problem:
> 
> I have a form which presents the user with a table of dates with
> checkboxes for a three month period, e.g.
> 
> Dec           7th     14th    21st    28th
>       am      [ ]     [ ]     [ ]     [ ]
>       pm      [ ]     [ ]     [ ]     [ ]
> 
> Jan           4th     11th    18th    25th
>       am      [ ]     [ ]     [ ]     [ ]
>       pm      [ ]     [ ]     [ ]     [ ]
> 
> Feb           1st     8th     15th    22nd    29th
>       am      [ ]     [ ]     [ ]     [ ]     [ ]
>       pm      [ ]     [ ]     [ ]     [ ]     [ ]
> 
> When the user submits the form with any of the boxes checked I
> want to have these sorted into date order.
> 
> If I check Dec 28th am and pm, Jan 4th am and pm, Jan 18th am and
> pm and Feb 15th am and pm then the order returned in the _POST is:
> 
> Dec 28 am, Dec 28 pm, Jan 4 am, Jan 18 am, Jan 4 pm, Jan 18 pm,
> Feb 15 am, Feb 15 pm
> 
> This is, I believe, due to the order of the elements in the form.
> I tried using tabindex to influence the order returned but to no
> avail. So I'm now trying to do this in the php code that processes
> the submission. There is no year info such that I could turn the
> dates into timestamp and sort that way. Has anyone got any code
> that can sort this correctly?
> 
> Cheers, Greg.
> -- 
> Greg Wiley
> http://wileysworld.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to