The What
Description
The array_key_exists
checks if the specified key exists in the specified array. Remember that all array elements are keyed in arrays either by the declared, literal key or by the implied numerical index key.
Parameters
key
- Key or index you want to check in the array.
array_variable
- The array to check.
Return Values
It returns TRUE
when the key does exist in the array; else it returns FALSE
.
Show It in ActionBasic
Let’s see the array_key_exists
function in action. In this video, you will see how it works.
If you listen carefully, you can hear the 1s and 0s flowing in your computer.
Go DeepPro
In this video, you will go deeper into the instruction.
WhenPro
In this video, you will learn when to use array_key_exists
.