User Tools

Site Tools


Sidebar

array:array_key_exists

array_key_exists()

Function to check whether a given array key exists in the array. This function is taken from php.js.

Usage

var key = "myKey";
if(array_key_exists(key, array)) {
   //Do something if the key exists in the array.
}

Parameters

Parameter Data type Required Description
key string / number Yes The key to search for
search array Yes The array to search

Return values

Value Meaning
true The key exists in the given array
false The key does not exist in the given array
array/array_key_exists.txt · Last modified: 2017/05/20 12:49 (external edit)