$needle = array('p', 'c'); $haystack = array('a', 'b', 'c'); echo (count(array_intersect($needle, $haystack))) ? "found" : "not found";