PHP Questions Home
Categories
Arrays
Files
Forms
Functions
Images
MySQL
Numbers
Others
Strings
Website
Unanswered

PHP Functions
PHP Functions

More PHP
Top Questions
Ask a Question
Sponsors

sponsor ad
Advertise Here

How can I sort a multi-dimensional array?


This can easily be done using the function in PHP that is called array_multisort.

Here is an example of this function in action:

<?php

$multiarray 
= array(array(5,4,3,2,1),array(7,8,2,9,10));

array_multisort($multiarray[0],SORT_ASC);

print_r($multiarray);
?>



Ask a Question / Comment on this Question and Answer >>>

More arrays PHP Questions

How do you remove duplicate values from an array?
How can I display a 2 dimensonal array?
How do I sort the members of an array by value?
How can I loop through the members of an array?
I am not interested in the values in the arrays, how can I discard them?