Page 1 of 1

Sorting a multidimensional array

Posted: Sat Mar 06, 2004 2:34 pm
by Ixplodestuff8
I need help sorting a multidimensional arary.

Lets say I have this for example

Code: Select all

<?php

$array[$i]["foo"] = "bar";

$array[$i]["bar"] = "foo";

$i++;

$array[$i]["foo"] = "foo";


$array[$i]["bar"] = "bar";

?>
How could I order alphabetically, the values in the ["foo"] key ?

edit: I found out how to do it using usort, so problem solved.