function select_or_other_multi_array_key_exists in Select (or other) 7.3
Same name and namespace in other branches
- 6.2 select_or_other.module \select_or_other_multi_array_key_exists()
- 7.2 select_or_other.module \select_or_other_multi_array_key_exists()
Helper function to check keys in multidimensional array.
Parameters
$needle: The key.
$haystack: The array to check.
Return value
boolean Boolean indicating if the key is set.
1 call to select_or_other_multi_array_key_exists()
- select_or_other_element_process in ./
select_or_other.module - Process callback for a Select (or other) element.
File
- ./
select_or_other.module, line 256 - The Select (or other) module.
Code
function select_or_other_multi_array_key_exists($needle, $haystack) {
if (array_key_exists(html_entity_decode($needle, ENT_QUOTES), $haystack)) {
return TRUE;
}
else {
foreach ($haystack as $key => $value) {
if (is_array($value) && select_or_other_multi_array_key_exists($needle, $value)) {
return TRUE;
}
}
}
return FALSE;
}