Phparray_intersect () function use code _ PHP Tutorial

Source: Internet
Author: User
The phparray_intersect () function uses code. The arrayarray_intersect (arrayarray1, arrayarray2 [, array...]) array_intersect () function returns an intersection array of two or more arrays. Array_intersect () returns an array, which is array array_intersect (array array1, array array2 [, array...])
The array_intersect () function returns the intersection array of two or more arrays.
Array_intersect () returns an array containing all values that appear in the array of all other parameters at the same time in array1. Note that the key name remains unchanged.
The following is an example in the manual:


$ Array1 = array ("a" => "green", "red", "blue ");
$ Array2 = array ("B" => "green", "yellow", "red ");
$ Result = array_intersect ($ array1, $ array2 );
Print_r ($ result );
?>
The output result is as follows:

Array
(
[A] => green
[0] => red
)

The http://www.bkjia.com/PHPjc/319826.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/319826.htmlTechArticlearray array_intersect (array array1, array array2 [, array...]) array_intersect () function returns an intersection array of two or more arrays. Array_intersect () returns an array, which is...

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.