http://www.php.net/manual/function.array-multisort.php

Matthew Brealey wrote:
> 
> I have a 2-d array:
> 
> $list[$ctr]["username"]
> $list[$ctr]["county"]
> $list[$ctr]["age"]
> $list[$ctr]["id"]
> $list[$ctr]["days"]
> 
> I need to sort by days, which is an integer. What function should I use?
> 
> E.g.,
> $list[0][mark]
> $list[0][somewhere]
> $list[0][12]
> $list[0][1]
> $list[0][200]
> 
> $list[1][andy]
> $list[1][somewherefurther]
> $list[1][18]
> $list[1][2]
> $list[1][100]
> 
> $list[2][sam]
> $list[2][somewhereelse]
> $list[2][15]
> $list[2][3]
> $list[2][150]
> 
> should sort to:
> 
> $list[0][mark]
> $list[0][somewhere]
> $list[0][12]
> $list[0][1]
> $list[0][100]
> 
> $list[1][andy]
> $list[1][somewherefurther]
> $list[1][18]
> $list[1][2]
> $list[1][150]
> 
> $list[2][sam]
> $list[2][somewhereelse]
> $list[2][15]
> $list[2][3]
> $list[2][150]
> -- Random (non-anti-Microsoft) fortune
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
Monte Ohrt <[EMAIL PROTECTED]>
http://www.ispi.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to