summaryrefslogtreecommitdiffstats
path: root/etc/inc/util.inc
diff options
context:
space:
mode:
Diffstat (limited to 'etc/inc/util.inc')
-rw-r--r--etc/inc/util.inc13
1 files changed, 13 insertions, 0 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc
index 5539400..a052fbc 100644
--- a/etc/inc/util.inc
+++ b/etc/inc/util.inc
@@ -1773,4 +1773,17 @@ function get_alias_list($type = null) {
return $result;
}
+/* returns an array consisting of every element of $haystack that is not equal to $needle. */
+function array_exclude($needle, $haystack) {
+ $result = array();
+ if (is_array($haystack)) {
+ foreach ($haystack as $thing) {
+ if ($needle !== $thing) {
+ $result[] = $thing;
+ }
+ }
+ }
+ return $result;
+}
+
?>
OpenPOWER on IntegriCloud