I'm running into the following problem when I try to use the array_multisort fuction. I'm trying to sort by date [1], then report name [0]. If I print out the multi-dimensional array before the array_multisort function, I recieve the following:
Array ( [0] => Array ( [0] => change [1] => 2003-09-24 [2] => 2003-09-24_change.pdf )
[1] => Array ( [0] => stats_client_summary [1] => 2003-10-06 [2] => 2003-10-06_stats_client_summary.pdf )
[2] => Array ( [0] => change [1] => 2003-10-07 [2] => 2003-10-07_change.pdf ) )
Then I run this statement to sort the multi-dimensional array:
array_multisort($TestArray[1], $TestArray[0]);
This is the sorted array that is returned:
Array ( [0] => Array ( [0] => 2003-09-24 [1] => 2003-09-24_change.pdf [2] => change )
[1] => Array ( [0] => 2003-10-06 [1] => 2003-10-06_stats_client_summary.pdf [2] => stats_client_summary )
[2] => Array ( [0] => change [1] => 2003-10-07 [2] => 2003-10-07_change.pdf ) )
The returned array is screwed up, [1] is moved to [0] in the first 2 rows, and it is not sorted. Does anyone know what I am doing wrong here?? Thanks!!
Array ( [0] => Array ( [0] => change [1] => 2003-09-24 [2] => 2003-09-24_change.pdf )
[1] => Array ( [0] => stats_client_summary [1] => 2003-10-06 [2] => 2003-10-06_stats_client_summary.pdf )
[2] => Array ( [0] => change [1] => 2003-10-07 [2] => 2003-10-07_change.pdf ) )
Then I run this statement to sort the multi-dimensional array:
array_multisort($TestArray[1], $TestArray[0]);
This is the sorted array that is returned:
Array ( [0] => Array ( [0] => 2003-09-24 [1] => 2003-09-24_change.pdf [2] => change )
[1] => Array ( [0] => 2003-10-06 [1] => 2003-10-06_stats_client_summary.pdf [2] => stats_client_summary )
[2] => Array ( [0] => change [1] => 2003-10-07 [2] => 2003-10-07_change.pdf ) )
The returned array is screwed up, [1] is moved to [0] in the first 2 rows, and it is not sorted. Does anyone know what I am doing wrong here?? Thanks!!