Re: sorting arrays

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2005-03-08 at 22:56, Gabino Travassos wrote:
> Hello List
> 
> I've looked at array_multisort( ), but it doesn't seem like the right 
> function. Here's an example of my array, it's a listing of CD reviews:
> $cds=array(array("Lowest of the Low", 20050105,9,"Toronto"), array("Heavy 
> Blinkers",20041020,6,"Chicago"), array("Apple,Fiona",20050308,5,"Seattle"));
> 
> If I wanted to sort them alphabetically, no problem, just sort($cds).
> If I want to sort them by date (the second item in the array) or by ranking 
> (the third), how do I do that?
> 
> Is there something simple?

Simple as it gets for what you want:

    http://ca3.php.net/manual/en/function.usort.php

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 |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux