Re: Sorting multidimensional arrays
| From: | Dave Goodchild | Date: | Thu, 16 Nov 2006 16:37:42 +0000 |
| Subject: | Re: Sorting multidimensional arrays | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-244727@lists.php.net to get a copy of this message | ||
Result. Cheers!
On 11/16/06, Robert Cummings <robert@interjinn.com> wrote:
On Thu, 2006-11-16 at 15:28 +0000, Dave Goodchild wrote: Hi all. I have a multidimensional array here: Bums" ["name"]=> string(13) "Tits And Bums" [3]=> string(19) "The Pleasure [--SNIP--] ...which comprises a set of returned results for an events search - with the date computed dynamically and added to the end of the array in each case. What I want to do with this data is display the array in an html table, sorted by the date. At the moment the display shows each event from earliest to last date, then the next event from earliest to last etc. What I want to do is display all the data from earliest to last date - my question is, how do I sort the entire array based on the date value in the second level array? usort() Cheers, Rob. -- .------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn |-- http://www.web-buddha.co.uk| also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. |`------------------------------------------------------------'