Home > Article > Backend Development > PHP array function array_key_exists() finds whether the array key exists
Contents of this section: PHP array function array_key_exists() array_key_exists() definition and usage The array_key_exists() function determines whether the specified key exists in an array. If the key exists, it returns true, otherwise it returns false. Grammar array_key_exists(key,array) Parameter Description key is required. Specifies the key name. array required. Specifies the input array. Example 1, PHP array function array_key_exists().
Output: Key exists! Example 2, PHP array function array_key_exists().
Output: Key does not exist! Example 3, PHP array function array_key_exists().
Output: Key exists! |