Checks if a value exists in an array.
Syntax
in_array(mixed $needle, array $haystack): boolExample
Enter values below to update the example in real time.
fruits→var_dump→in_array→$fruits = ["apple", "banana", "cherry"];
var_dump(in_array("banana", $fruits)); // bool(true)