Corrected (haystack, needle) to (needle, haystack) for in_array().