Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

- fixed the array_erase helper.

  • Loading branch information...
commit b22f0c040359025b5f6ed7ab4b6da7bda6015964 1 parent 4f7f032
@kamicane authored
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;
}
Please sign in to comment.
Something went wrong with that request. Please try again.