Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私は2つの配列を持っています:array("blue", "yellow")とarray("blue", "green", "red", "purple")。これらの2つの配列に共通の要素値(「青」)が少なくとも1つあるかどうかをチェックする関数はありますか?trueまたはfalseを返すだけです。
array("blue", "yellow")
array("blue", "green", "red", "purple")
$array1 = array("blue", "yellow"); $array2 = array("blue", "green", "red"); return count(array_intersect($array1, $array2)) > 0;