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.

Syntax:

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

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


Prem Tiwari

An engineer by profession and a passionate blogger by heart. Founder of FreeWebMentor.com (A Programming blog for beginners), Tech Speaker at various forums. A part from this he is an open source enthusiast, WordPress Lover, Blogger, SEO, and Growth Strategic.