I have a table of users, each user has a course history that looks like this:
;0001,Econ 101, Economics Dept,2007-12-31;0013,Intro to Psychology,Education & Behavior Dept,2007-07-06
The back end user can go in and view this for each user, or print a PDF transcript.
I am using explode to break the string on the semicolons, each resulting string being then split and printed using list($ClassID, $Title, $Dept, $Date).
The output looks like this:
0001 -- Econ 101 -- Economics Dept -- 2007-12-31
0013 -- Intro to Psychology -- Education & Behavior Dept -- 2007-12-31
Now, what I'd prefer to do is rather than list them all in series, is sort them by the third variable, $Dept, and then display like this:
Economics Dept
Econ 101, 2007-12-31
Education & Behavior Dept
Intro to Psychology, 2007-12-31
So I'm looking for help on how to read the array, then sort before outputting.