Skip to content

array_intersection

Hyomoto edited this page Jun 13, 2021 · 2 revisions
Jump To Go Back Arguments

array_intersection( array1, array2 )

Returns: array

Throws: InvalidArgumentType

Returns a new array containing the intersection of both arrays. These are the values that are shared by both arrays, except duplicates. If an array is not provided to either argument, InvalidArgumentType will be thrown.

array_intersection( [ 10, 20, 30 ], [ 20, 30, 40 ] );
Output: [ 20,30 ]

Arguments

Name Type Purpose
array1 array No description
array2 array No description
Clone this wiki locally