PHP array_key_first() Function

The array_key_first() is an inbuilt function of PHP and is used to gets the first key of an array. You can get the first key from given array without affecting the internal array pointer.


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.


Parameter Description
key Required. Specifies the key
array Required. Specifies an array

PHP array_key_first() Function with example

Example #1 BasicĀ array_key_first() function

Example #2 Basic array_key_first() function


If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.

Recommended Posts: