diff options
author | Eric Roberts <eric@cryode.com> | 2012-07-11 10:43:36 +0200 |
---|---|---|
committer | Eric Roberts <eric@cryode.com> | 2012-07-11 10:43:36 +0200 |
commit | fa337081ced1b1d34805d28f8307f069edf16cdf (patch) | |
tree | 63e524a282d7a8efef45b205c42f9b8e4a06b89b /system/helpers/array_helper.php | |
parent | 6bf1e50bdff62d4842cd5a94d324e0768c5ace3e (diff) | |
parent | 78e5fdfe4399975b75b8697f64e270b1799ee2f1 (diff) |
Merge branch 'develop' of https://github.com/EllisLab/CodeIgniter into develop
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; |