➤ The in_array() function searches an array for a specific value. Syntax:
in_array(search, array, type) // third parameter is optional 
For instance:
$colours = ["Red", "Black", "White"];

if (in_array("Black", $colours))
  echo "Match found!";
else
  echo "Match not found!";
  // outputs:     Match found!
by Levani Makhareishvili
2 years ago
PHP
Arrays
Function
1
Pro tip: use ```triple backticks around text``` to write in code fences