Onetastic Macro Documentation >
>
>
Array_KeyExists Array_KeyExists
Returns whether a given key exists or not in the given array.
Syntax
Array Array_KeyExists(
Array array,
Mixed key)
Parameters
- Array array
- Array to look for the key in.
- Mixed key
- Key to look for.
Examples
$array = Array(3, 89, 47, 21, 23)
$found3 = Array_KeyExists($array, 3)
$found7 = Array_KeyExists($array, 7)
$array["color"] = "red"
$array["size"] = "large"
$foundSize = Array_KeyExists($array, "size")
$foundType = Array_KeyExists($array, "type")
|