时间:2021-07-01 10:21:17 帮助过:32人阅读
输出:
<?php
$a=array("a"=>"Dog","b"=>"Cat");
if (array_key_exists("a",$a))
{
echo "Key exists!";
}
else
{
echo "Key does not exist!";
}
?>
输出:
<?php
$a=array("a"=>"Dog","b"=>"Cat");
if (array_key_exists("c",$a))
{
echo "Key exists!";
}
else
{
echo "Key does not exist!";
}
?>
输出:
<?php
$a=array("Dog",Cat");
if (array_key_exists(0,$a))
{
echo "Key exists!";
}
else
{
echo "Key does not exist!";
}
?>