php array_key_exists() function
Translation results:
英[ɪgˈzɪst] 美[ɪɡˈzɪst]
##vi.Existence; survive; live; continue to existThird person singular: exists Present participle: existing Past tense: existed Past participle: existedphp array_key_exists() functionsyntax
Function: Check whether the specified key name exists in an array
Syntax: array_key_exists(key,array)
Parameters:
Parameters | Description |
key | Required. Specifies the key name. |
array | Required. Specifies an array. |
Description: Returns true if the key name exists, returns false if the key name does not exist.
php array_key_exists() functionexample
<?php $a=array("php中文网"=>"西门大官人","php中文网"=>"灭绝师太"); if (array_key_exists("phpStudy",$a)) { echo "存在!"; } else { echo "不存在!"; } ?>
Run instance»
Click the "Run instance" button to view the online instance
Output:
不存在!