Check if the key "Volvo" exists in an array:
<?php
$a=array("Volvo"=>"XC90","BMW"=>"X5");
if (array_key_exists("Volvo",$a))
  {
  echo "Key exists!";
  }
else
  {
  echo "Key does not exist!";
  }
?>
by გიორგი ბაკაშვილი
4 years ago
PHP
Array
PHP official doc
1
Pro tip: use ```triple backticks around text``` to write in code fences