PHP array_intersect_assoc() FunctionLast Updated : 17 Mar 2025 The array_intersect_assoc() is used to create an array containing keys and values of the first array whose values (i.e., from the first array) are present in all other arrays, while the index of values is same for all the given arrays. This function was introduced in PHP 4.3.0. SyntaxParameter
Return TypeThe function returns another array that contains the intersection of all the input arrays. If no element matches, a NULL array is returned. EXAMPLE 1Output: Array ( [a] => Orange ) EXAMPLE 2Output: Array ( [100] => sachin ) EXAMPLE 3Output: Array ( [a] => java [b] => php ) EXAMPLE 4Output: Array ( [a] => black ) Next TopicPhp-array-intersect-function |
We request you to subscribe our newsletter for upcoming updates.

We deliver comprehensive tutorials, interview question-answers, MCQs, study materials on leading programming languages and web technologies like Data Science, MEAN/MERN full stack development, Python, Java, C++, C, HTML, React, Angular, PHP and much more to support your learning and career growth.
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India