Check if the key "XML" exists in an array in PHP
Description
The following code shows how to check if the key "XML" exists in an array.
Example
/*from w w w . java 2s. com*/
<?php
$a=array("XML"=>"data","CSS"=>"style");
if (array_key_exists("XML",$a)){
echo "Key exists!";
}else{
echo "Key does not exist!";
}
?>
The code above generates the following result.