Delve into PHP array_multisort_php tutorials

Source: Internet
Author: User
For first-time learning

Like this array_multisort ($arr 1, $arr 2, $arr 3); By default, all arrays are sorted in ascending order, and if you want to $arr2 in descending order and compare them as strings, write:

Array_multisort ($arr 1, $arr 2, Sort_desc, sort_string, $arr 3);

Each array can be followed by a sort order flag or a sort type flag, or both flags appear at the same time. However, each sort flag can only appear after each array.

PHP array_multisort sort order flag:

Sort_asc-Sort by ascending order (default)

Sort_desc-Sort by descending order

PHP Array_multisort Sort Type flags:

Sort_regular-Compare items by usual method (default)

Sort_numeric-Compare items by value

Sort_string-Compare items by string


http://www.bkjia.com/PHPjc/446072.html www.bkjia.com true http://www.bkjia.com/PHPjc/446072.html techarticle for first-time learning like this array_multisort ($arr 1, $arr 2, $arr 3); By default, all arrays are in ascending order, if you want to $arr2 descending, and as a string to compare, it should be written: ar ...

  • 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.