Multi-dimensional array sorting !!

Source: Internet
Author: User
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 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
  • TXT; $ ar = preg_split ('/
  • Chapter 1 No. 2213
    Chapter 2 delay of two years
    Chapter 3 E-level tactics
    Chapter IV first confrontation
  • Chapter 5 Initial force
  • Chapter 6 storage card
  • Chapter 7 bans
    Chapter 8 force control
    Chapter 9 saving me Supreme
    Chapter 10 first murder
  • Chapter 2 baby black cloth
  • Chapter 3 E-level Dodge training
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.