Possible Duplicate:
How do I sort a multidimensional array by one of the fields of the inner array in PHP?
I would like to know, how can we custom sort a multi-dimentional array. The array contains values like:-
$products = array(
array('John', '155', 10 ),
array( 'Paul', '151', 95 ),
array( 'Rodger', '152', 85 )
);
In the first array, John is the name, 155 is the ID and 10 is the Price. How can I sort the whole array by Price(Highest to Lowest) and then print the data using a foreach
loop?