PHP Questions Home | Register | Login
Categories
Arrays
Files
Forms
Creating PDFs
PHP Errors
Functions
Images
MySQL
Numbers
Others
Strings
Website
Unanswered

PHP Forums
Forums Index
MySQL Forum
PHP Forum
Flash/Actionscript
Javascript
Web design

More PHP
PHP Functions
Top Questions
Ask a Question
PHP Interview Questions
PHP Jobs
Ecommerce
IT Questions
Business Websites

Sponsors

sponsor ad
My Salary
PHP Developer Salary
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);
?>



Comment on this Question and Answer >>>

ASK A QUESTION

More arrays PHP Questions

How do I remove and view the last element of an array?

How do I sort the members of an array by value?

How do I add to the end of an array and know how large the array is?

How can I reset an array in PHP?

How do I return all the values in an array?



Custom Search