Sorting Multidimensional Array

Sorting Multidimensional Array

Post by larentiu » Thu, 02 Nov 2006 02:10:13


Hi,

RE: Sorting Multidimensional Array

I'm trying to sort a multidimensional array. The data was taken from
a mysql query:

$myrow = mysql_fetch_row($result) {
query[] = $myrow;
}

The purpose is to retrieve the table data and manually add a record,
then sort ASC by the startdate which is the forth field...

Something like:

$test = array_multisort($query, $key = '$query[4]');

Any help would be greatly appreciated. Thanks,


Keith
 
 
 

1. Sort MultiDimensional Array

2. sort multidimensional arrays?

Is there a way to sort multidimensional arrays?

You can sort simple arrays:
myArray = ['b','a','c'];
myArray.sort();
trace(myArray);

That would alphabetize the array and return a,b,c.


How would you sort the following array, alphabetizing myArray[x][0]:
myArray = [['b','green'],['a','red'],['c','blue']];

So it returns red, green, blue? Seems like it would be simple.

TIA
Jeremy

3. Problems sorting multidimensional array

4. Sort multidimensional array

5. Sorting multidimensional array

6. Sorting multidimensional array based on variable

7. Sorting Multidimensional Array

8. Sorting multidimensional arrays

9. sorting multidimensional array

10. Sorting Multidimensional Arrays

11. Sorting multidimensional arrays

12. Split multidimensional array into 4 multidimensional arrays

13. Alpha multidimensional array sort

14. How do a sort a multidimensional array(1000,2) in Excel-VBA?

15. Sorting a multidimensional array by multiple keys