php - how to check if at least one element of first array exists in second array

arrays, php

Solution

$array1 = array("blue", "yellow");
$array2 = array("blue", "green", "red");

return count(array_intersect($array1, $array2)) > 0;

Problem

I have two arrays : `array("blue", "yellow")` and `array("blue", "green", "red", "purple")`. Is there a function that will check if those two arrays have at least one element value in common ("blue") - just return true or false.

Original source