Array_key_exists () checks whether the given key name or index exists in the array [function] This function returns a boolean value. if the specified key exists in the specified array, true is returned, otherwise, false is returned. This function can also be used for objects, that is, to check whether the specified key is... syntaxHighlighter. all (
Array_key_exists () checks whether the given key name or index exists in the array.
[Function]
This function returns a boolean value,
If the specified key exists in the specified array, true is returned; otherwise, false is returned.
This function can also be used 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/required/search array
[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
*/
Taken from zuodefeng's note