Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# inArray example
$fruits = ['Banana', 'Blackcurrant', 'Blueberry', 'Chili pepper', 'Cranberry', 'Eggplant', 'Gooseberry'];
# You get true or false
$result = in_array("Blueberry", $fruits);
# output true
# if value not available
$result = in_array("Apple", $fruits);
# output false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment