Multi-dimensional array sorting !!
Chapter 1 No. 2213
Chapter IV first confrontation
Chapter 2 delay of two years
Chapter 5 Initial force
Chapter 3 E-level tactics
Chapter 6 storage card
Chapter 7 bans
Chapter 10 first murder
Chapter 8 force control
Chapter 2 baby black cloth
Chapter 9 saving me Supreme
Chapter 3 E-level Dodge training
How can code like this be correctly sorted by multi-dimensional arrays ?? Tutorial
Reply to discussion (solution)
If no array is displayed, set it up.
The href value is unique and can be sorted. it is estimated that preg_match_all should be used to match and sort in the sub-group mode, and then re-organize the output.
Metadata is based on the "chapter.
If you sort by chapter, we recommend that you set a identifier before sorting.
$ S = <TXT
Chapter 1 No. 2213
Chapter IV first confrontationChapter 2 delay of two years
Chapter 5 Initial forceChapter 3 E-level tactics
Chapter 6 storage cardChapter 7 bans
Chapter 10 first murderChapter 8 force control
Chapter 2 baby black clothChapter 9 saving me Supreme
Chapter 3 E-level Dodge trainingTXT; $ ar = preg_split ('/
Chapter 1 No. 2213
Chapter 2 delay of two years
Chapter 3 E-level tactics
Chapter IV first confrontationChapter 5 Initial forceChapter 6 storage cardChapter 7 bans
Chapter 8 force control
Chapter 9 saving me Supreme
Chapter 10 first murderChapter 2 baby black clothChapter 3 E-level Dodge training