(PHP 4 >= 4.0.7, PHP 5, PHP 7)
array_key_exists — 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷欠锟斤拷锟街革拷锟斤拷募锟斤拷锟斤拷锟斤拷锟斤拷锟�
锟斤拷锟斤拷锟斤拷锟叫硷拷 key
时锟斤拷array_key_exists() 锟斤拷锟斤拷 TRUE
锟斤拷
key
锟斤拷锟斤拷锟斤拷锟轿猴拷锟斤拷锟斤拷为锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷值锟斤拷
key
要锟斤拷锟侥硷拷锟斤拷
array
一锟斤拷锟斤拷锟介,锟斤拷锟斤拷锟斤拷锟斤拷锟侥硷拷锟斤拷
锟缴癸拷时锟斤拷锟斤拷 TRUE
锟斤拷 锟斤拷锟斤拷锟斤拷失锟斤拷时锟斤拷锟斤拷 FALSE
锟斤拷
Note:
array_key_exists() 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷一维锟侥硷拷锟斤拷 锟斤拷维锟斤拷锟斤拷锟斤拷嵌锟阶的硷拷锟斤拷锟结被锟斤拷锟斤拷锟斤拷锟斤拷
Example #1 array_key_exists() 锟斤拷锟斤拷
<?php
$search_array = array('first' => 1, 'second' => 4);
if (array_key_exists('first', $search_array)) {
echo "The 'first' element is in the array";
}
?>
Note:
锟斤拷锟斤拷为锟剿硷拷锟斤拷锟斤拷前锟芥本锟斤拷锟斤拷锟� object 锟斤拷锟斤拷
array
锟斤拷锟斤拷 array_key_exists()锟斤拷同时key
锟角讹拷锟斤拷锟斤拷锟斤拷裕锟揭诧拷岱碉拷锟�TRUE
锟斤拷 锟斤拷要锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷裕锟斤拷锟街わ拷锟斤拷锟�array
锟斤拷锟斤拷锟斤拷锟斤拷锟介(array锟斤拷锟斤拷要锟斤拷锟斤拷锟斤拷锟角凤拷锟斤拷某锟斤拷锟斤拷锟皆o拷应锟斤拷去锟斤拷 property_exists()锟斤拷