public static function gapi::ArrayKeyExists in Google Analytics Statistics 7.2
Case insensitive array_key_exists function, also returns matching key.
Parameters
String $key:
Array $search:
Return value
String Matching array key
3 calls to gapi::ArrayKeyExists()
- gapi::__call in includes/
gapi.class.php - Call method to find a matching root parameter or aggregate metric to return
- gapiAccountEntry::__call in includes/
gapi.class.php - Call method to find a matching parameter to return
- gapiReportEntry::__call in includes/
gapi.class.php - Call method to find a matching metric or dimension to return
File
- includes/
gapi.class.php, line 398
Class
- gapi
- GAPI - Google Analytics PHP Interface
Code
public static function ArrayKeyExists($key, $search) {
if (array_key_exists($key, $search)) {
return $key;
}
if (!(is_string($key) && is_array($search))) {
return false;
}
$key = strtolower($key);
foreach ($search as $k => $v) {
if (strtolower($k) == $key) {
return $k;
}
}
return false;
}