I have text within a comma-delimited file I want to sort but am really stumped on how to do it.
Part of the issue is that there are sub-sections of the file that need to be sorted, while the rest remains the same. Here's an example of the file.
headerline1,,,
headerline2,,,
headerline3,,,
Division,35 and Under,,,
2,RacerA,hometown,225
1,RacerC,hometown,221
3,RacerD,hometown,223
4,RacerB,hometown,224
Division,17 and Over,,,
1,RacerA,hometown,225
2,RacerC,hometown,221
3,RacerD,hometown,223
4,RacerB,hometown,224
There could be multiple "divisions" and racers within each division. I need to sort based on the First field (ie, 1,2,3,4)
Any help/direction on this would be great. My attempt to use file() to read them in and then array_multisort has only resulted in a headache and drinking problem.
-Topher