Difference sets and intersections in arrays of PHP array functions

Source: Internet
Author: User

Array_diff ($arr, $arr 2[...]) Returns an array that contains all the values in $ARR1 but not in any other parameter array, with the key name unchanged

Array_diff_uassoc ($arr, $arr 2, [...], ' cmp_function ') using a callback function to index the difference set in an array

Array_diff_assoc ($arr, $arr 2[...]) returns an array that $arr the difference between the other array and the key name index unchanged


Array_udiff ($arr, $arr 2 [...], ' cmp_function ') compare the data with the callback function to calculate the difference set of the array

Array_udiff_uassoc ($arr, $arr 2, [...] , ' cmp_function ') with index to check the difference set of arrays, using callback function to compare data and indexes

Array_udiff_assoc ($arr, $arr 2, [...], ' cmp_function ') the difference set with the index check array is compared with the callback function comparison data key name


Array_intersect ($arr, $arr 2[...]) Returns an array $arr the intersection of key names with other arrays

Array_intersect_assoc ($arr, $arr 2[...]) returns an array $arr the intersection of the other arrays and compares the key names, the index does not change

Array_intersect_uassoc ($arr, $arr 2 [...], ' cmp_function ') the intersection of an array with an index check, using a callback function, to compare the index

Array_intersect_key ($arr, $arr 2 [...]) compare the intersection of an array with a key name

Array_intersect_ukey ($arr, $arr 2 [...], ' cmp_function '); Computes the intersection of an array using a callback function to compare the key names


Array_uintersect ($arr, $arr 2 [...]. ' Cmp_function ') Compare the intersection of the array with the callback function to compare the data

Array_uintersect_assoc ($arr, $arr 2[...], ' cmp_function ') compare data with a callback function with the intersection of an index check array

Array_uintersect_uassoc ($arr, $arr 2 [...] ' Cmp_function ') with the intersection of the index check array, using the callback function to compare the data and the index


Difference sets and intersections in arrays of PHP array functions

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.