Checking a key in an array
Check if a key exists in the array: key_exists()
The key_exists()
function is an alias array_key_exists()
.
You can use key_exists()
in order to check if the key exists and you can access it.
For a non-associative array the keys are 0, 1, 2 โฆ
For an associative array