Assalamualaikum , I am going to explain the difference between mostly used PHP built-in function. in_array — Checks if a value exists in an array in_array ( mixed$needle , array $haystack [, bool $strict = FALSE ]) : bool
needle : The searched value.If needle is a string, the comparison is done in a case-sensitive manner.
The second condition fails because in_array() is case-sensitive, so the program above will display: array_search — Searches the array for a given value and returns the first corresponding key if successful array_search ( mixed$needle , array $haystack [, bool $strict = FALSE ]) : mixed
Return Value: Returns the key for needle if it is found in the array, FALSE otherwise.