diff options
Diffstat (limited to 'system/helpers/array_helper.php')
-rw-r--r-- | system/helpers/array_helper.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/system/helpers/array_helper.php b/system/helpers/array_helper.php index 5d0243951..ed2fe3c4a 100644 --- a/system/helpers/array_helper.php +++ b/system/helpers/array_helper.php @@ -52,7 +52,7 @@ if ( ! function_exists('element')) */ function element($item, $array, $default = NULL) { - return empty($array[$item]) ? $default : $array[$item]; + return array_key_exists($item, $array) ? $array[$item] : $default; } } @@ -95,7 +95,7 @@ if ( ! function_exists('elements')) foreach ($items as $item) { - $return[$item] = isset($array[$item]) ? $array[$item] : $default; + $return[$item] = array_key_exists($item, $array) ? $array[$item] : $default; } return $return; |