php-arrays function-array_intersect_assoc-with index check the intersection of computed arrays _php tutorial

Source: Internet
Author: User
ARRAY_INTERSECT_ASSOC () The intersection of the computed array with an index check

"Function" The function returns an array,
The array contains all of the values in array1 but not in any other parameter array.
Note that unlike the Array_intersect () function, the key name is also used for comparison.
"Scope of Use"
php4>=4.3.0, PHP5.
Use
Array Array_intersect_assoc (array array1, array array2[,array ...])
array1/Required/Array 1
array2/required/Compared arrays must have at least one
Array.../Optional/used to compare the array
Example
[PHP]
Define two arrays separately
$array 1 = Array ("Blue" = 6, "Red" = 2, "green" = 3, "purple" = 4);
$array 2 = Array ("Green" =>5, "blue" = 6, "Yellow" = 7, "cyan" = 8);
Print_r (Array_intersect_assoc ($array 1, $array 2));
/*
Array
(
[Blue] = 6
)
*/


Excerpts from Zuodefeng's notes

http://www.bkjia.com/PHPjc/478207.html www.bkjia.com true http://www.bkjia.com/PHPjc/478207.html techarticle Array_intersect_assoc () with index check computes the intersection of an array "function" The function returns an array that contains all of the array1 but not in any other parameter array ...

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