To check key in array, we can use array_key_exists().

$item=array("name"=>"umesh","class"=>"mca");
if (array_key_exists("name",$item))
{
echo "Key is exists";
}
else
{
echo "Key does not exist!";
}

Suggest An Answer

No suggestions avaliable!