in_array Checks if a value exists in an array &reftitle.description; boolin_array mixedneedle arrayhaystack boolstrict&false; Searches for needle in haystack using loose comparison unless strict is set. &reftitle.parameters; needle The searched value. If needle is a string, the comparison is done in a case-sensitive manner. haystack The array. strict If the third parameter strict is set to &true; then the in_array function will also check the types of the needle in the haystack. Prior to PHP 8.0.0, a string needle will match an array value of 0 in non-strict mode, and vice versa. That may lead to undesireable results. Similar edge cases exist for other types, as well. If not absolutely certain of the types of values involved, always use the strict flag to avoid unexpected behavior. &reftitle.returnvalues; Returns &true; if needle is found in the array, &false; otherwise. &reftitle.examples; <function>in_array</function> example ]]> The second condition fails because in_array is case-sensitive, so the program above will display: <function>in_array</function> with strict example ]]> &example.outputs; <function>in_array</function> with an array as needle ]]> &example.outputs; &reftitle.seealso; array_search isset array_key_exists