array_intersect_key

PHP 5 >= 5.1.0, PHP 7, PHP 8
array_intersect_key - Computes the intersection of arrays using keys for comparison

array_intersect_key( array$array, ... array$arrays ): array

array_intersect_key returns an array containing all the entries of array which have keys that are present in all the arguments.

Parameters

array

The array with master keys to check.

arrays

Arrays to compare keys against.

Return Values

Returns an associative array containing all the entries of array which have keys that are present in all arguments.

Related Functions

Example of array_intersect_key

Show all examples for array_intersect_key

PHP Version:


Function array_intersect_key:

Arrays Functions

Most used PHP functions