PHP Check if Key exist in array

PHOTO EMBED

Fri Jul 29 2022 17:32:55 GMT+0000 (Coordinated Universal Time)

Saved by @kalehm #undefined

<!DOCTYPE html>
<html>
<body>
​
<?php
$a=array("Volvo"=>"XC90","BMW"=>"X5");
if (array_key_exists("Volvo",$a))
  {
  echo "Key exists!";
  }
else
  {
  echo "Key does not exist!";
  }
?>
​
</body>
</html>
​
content_copyCOPY

https://www.w3schools.com/php/phptryit.asp?filename