php array_key_exists() function


  Translation results:

英[ɪgˈzɪst]   美[ɪɡˈzɪst]   

##vi.Existence; survive; live; continue to exist

Third person singular: exists Present participle: existing Past tense: existed Past participle: existed

php array_key_exists() functionsyntax

Function: Check whether the specified key name exists in an array

Syntax: array_key_exists(key,array)

Parameters:

ParametersDescription
keyRequired. Specifies the key name.
arrayRequired. 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:

不存在!

Home

Videos

Q&A