Array_key_exists () checks whether the given key name or index exists in the array
function
The function returns a Boolean value that
Returns true if the specified key exists in the specified array, otherwise false
The function can also be used with the object, that is, to check whether the specified key is in the object
"Scope of Use"
php4>4.1.0, PHP5.
Use
BOOL Array_key_exists (mixed Key,array search)
key/Required/Key Name
search/an array of required/found
Example
[PHP]
$search _array = Array (' First ' =>1, ' second ' =>4);
if (array_key_exists (' first ', $search _array)) {
echo "The ' first ' element is in the array";
}
/*
The ' first ' element is in the array
*/
Excerpts from Zuodefeng's notes
http://www.bkjia.com/PHPjc/478212.html www.bkjia.com true http://www.bkjia.com/PHPjc/478212.html techarticle array_key_exists () checks whether the given key name or index exists in the array "function" The function returns a Boolean value if the specified key exists in the specified array .