PHP array_key_exists() Function

The array_key_exists() function is used to check whether a specified key is present in an array or not.The function returns TRUE if the given key is set in the array. The key can be any value possible for an array index.

Example -

The array_key_exists() function checks an array for a specified key, and returns true if the key exists and false if the key does not exist.

Example -