PHP in_array() Function

The in_array() function is used to check whether a value exists in an array or not. in_array — Checks if a value exists in an array.Searches haystack for needle using loose comparison unless strict is set.The in_array() function searches an array for a specific value.

Example -

Example -