kriona wrote in php 😡frustrated

Multisorting

Okay.. I've got a multisorting problem I've been hacking at that I can't solve.

I have a chapters database (about 50 chapters) that was entered completely at random. What I need to do is
1) sort all chapters by the day they meet, starting on Sunday
2) sort for each day by whether the chapter is breakfast or lunch
3) sort for each breakfast/lunch by time of day the chapter meets
4) sort for each time of day the chapters meets by the name of the chapter

Basically, if we have

chapter[7] = Sunday-Breakfast-9-Palm Beach - (other junk)
chapter[22] = Sunday-Lunch-12-Boca - (other junk)
chapter[3] = Sunday-Breakfast-8-Delray - (other junk)
chapter[18] = Sunday-Breakfast-9-Boca - (other junk)

it should look like this:

chapter[3] = Sunday-Breakfast-8-Delray - (other junk)
chapter[18] = Sunday-Breakfast-9-Boca - (other junk)
chapter[7] = Sunday-Breakfast-9-Palm Beach - (other junk)
chapter[22] = Sunday-Lunch-12-Boca - (other junk)

the actual chapter's database, of course, has multiple days (to be announced is also considered a day they want displayed after all the other days)... does anyone have any suggestions? where should I start? I don't have a clue how to do this, because each chapter also has a bunch of random information thrown in there (email, contact person) that doesn't need sorting.