Permalink
Browse files

- fixed the array_erase helper.

  • Loading branch information...
1 parent 4f7f032 commit b22f0c040359025b5f6ed7ab4b6da7bda6015964 @kamicane committed May 1, 2010
Showing with 3 additions and 4 deletions.
  1. +3 −4 helpers/array.php
View
7 helpers/array.php
@@ -10,10 +10,9 @@ function array_include(&$array, $item){
}
function array_erase(&$array, $item){
- if (!array_contains($array, $item)) return $array;
-
- array_splice($array, $index, 1);
-
+ foreach ($array as $i => $v){
+ if ($array[$i] === $item) array_splice($array, $i, 1);
+ }
return $array;
}

0 comments on commit b22f0c0

Please sign in to comment.