Skip to content

Instantly share code, notes, and snippets.

@infinitbility
Created July 12, 2020 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save infinitbility/68423590812daaa501f133963ca1b6f9 to your computer and use it in GitHub Desktop.
Save infinitbility/68423590812daaa501f133963ca1b6f9 to your computer and use it in GitHub Desktop.
<?php
# 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