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.
Your best friend is code, Tonya is making the introductions.
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
.