Question : Sort Multidimensional Array PHP

Hi Experts,

Could someone help me sort this array with some PHP code?  I'd like to sort on the name in the (array[n]->[0]).

For example I'd like the resulting array to be ordered by the persons name alphabetically.  Right now they are ordered as the SQL query returned them.  I'd prefer to do it in PHP rather than SQL.

Doing the sort using the first letter in the name element (ie 'H'arvey Keitel) is fine.

Any ideas?

Thanks HNM
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
Array ( [0] => Array ( [0] => Player [1] => Position [2] => Att [3] => Comp [4] => TD [5] => Ints [6] => Conv [7] => Recep [8] => Drops [9] => Carries [10] => 1st Down [11] => Rouge [12] => Sacks [13] => Press [14] => Run-By [15] => Safeties [16] => Pass(D) ) 

[1] => Array ( [0] => Leonard Nemoi[1] => [2] => 0 [3] => 0 [4] => 1 [5] => 0 [6] => 0 [7] => 37 [8] => 2 [9] => 0 [10] => 12 [11] => 0 [12] => 0 [13] => 0 [14] => 0 [15] => 0 [16] => 1 )

[2] => Array ( [0] => Harvey Keitel[1] => [2] => 0 [3] => 0 [4] => 2 [5] => 0 [6] => 0 [7] => 9 [8] => 0 [9] => 0 [10] => 4 [11] => 0 [12] => 0 [13] => 0 [14] => 0 [15] => 0 [16] => 5 ) 

[3] => Array ( [0] => Doofy McFleur[1] => [2] => 0 [3] => 0 [4] => 2 [5] => 7 [6] => 0 [7] => 27 [8] => 4 [9] => 0 [10] => 8 [11] => 1 [12] => 0 [13] => 0 [14] => 0 [15] => 0 [16] => 8 ) 

[4] => Array ( [0] => Niki Minaj [1] => [2] => 0 [3] => 0 [4] => 0 [5] => 0 [6] => 0 [7] => 2 [8] => 0 [9] => 0 [10] => 2 [11] => 0 [12] => 0 [13] => 0 [14] => 0 [15] => 0 [16] => 2 ) 

[5] => Array ( [0] => Richard Simmons[1] => [2] => 0 [3] => 0 [4] => 1 [5] => 0 [6] => 0 [7] => 0 [8] => 0 [9] => 0 [10] => 0 [11] => 0 [12] => 6 [13] => 7 [14] => 2 [15] => 1 [16] => 2 ) 

[6] => Array ( [0] => Donald Duck[1] => [2] => 0 [3] => 0 [4] => 0 [5] => 7 [6] => 0 [7] => 3 [8] => 1 [9] => 0 [10] => 2 [11] => 0 [12] => 0 [13] => 0 [14] => 0 [15] => 0 [16] => 4 ) 

[7] => Array ( [0] => Bill Gates[1] => [2] => 0 [3] => 0 [4] => 0 [5] => 3 [6] => 0 [7] => 0 [8] => 0 [9] => 0 [10] => 0 [11] => 0 [12] => 0 [13] => 0 [14] => 0 [15] => 0 [16] => 5 ) 

[8] => Array ( [0] => Tommy Douglas[1] => [2] => 35 [3] => 21 [4] => 3 [5] => 1 [6] => 4 [7] => 23 [8] => 2 [9] => 7 [10] => 19 [11] => 0 [12] => 9 [13] => 1 [14] => 0 [15] => 0 [16] => 1 ) 

[9] => Array ( [0] => Leif Eriksen[1] => [2] => 0 [3] => 0 [4] => 0 [5] => 0 [6] => 0 [7] => 4 [8] => 0 [9] => 0 [10] => 2 [11] => 0 [12] => 1 [13] => 3 [14] => 4 [15] => 0 [16] => 0 ) 

[10] => Array ( [0] => Yngwie Malmsteen[1] => [2] => 0 [3] => 0 [4] => 2 [5] => 0 [6] => 1 [7] => 12 [8] => 3 [9] => 0 [10] => 5 [11] => 0 [12] => 0 [13] => 0 [14] => 0 [15] => 0 [16] => 1 ) 

[11] => Array ( [0] => Henry Ford[1] => [2] => 0 [3] => 0 [4] => 1 [5] => 4 [6] => 0 [7] => 4 [8] => 1 [9] => 0 [10] => 2 [11] => 0 [12] => 0 [13] => 0 [14] => 0 [15] => 0 [16] => 4 ) 

[12] => Array ( [0] => Andrew Carnegie [1] => [2] => 184 [3] => 129 [4] => 10 [5] => 10 [6] => 8 [7] => 0 [8] => 0 [9] => 2 [10] => 53 [11] => 4 [12] => 8 [13] => 0 [14] => 0 [15] => 0 [16] => 0 ) 

[13] => Array ( [0] => Perez Hilton[1] => [2] => 0 [3] => 0 [4] => 2 [5] => 2 [6] => 6 [7] => 31 [8] => 0 [9] => 0 [10] => 15 [11] => 0 [12] => 0 [13] => 0 [14] => 0 [15] => 0 [16] => 4 ) )

Answer : Sort Multidimensional Array PHP

why does this seem like a homework assignment?
1:
2:
3:
4:
5:
Select Student_name, sum(g.GPA)/count(*) from Student s left join [GPA] g on s.Student_ID=g.Student_ID where City+(case when len(state)=0 then '' else ', '+State end)+' '+Country in ('Atlanta, GA United States','New Orleans, LA United States', 'Seoul Korea')

Select Top 1 Student_ID,Student_Name from Student s left join [GPA] g on s.Student_ID=g.Student_ID where g.Course_name='MGT 3400' and g.year='2005' and g.Semester='Spring' order by GPA desc

Select Student_ID,Student_Name from Student s left join [GPA] g on s.Student_ID=g.Student_ID where g.Course_name='ART 4010' and g.year='2006' and g.Semester='Spring'
Random Solutions  
 
programming4us programming4us