summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorDarren Embry <dse@webonastick.com>2012-05-10 15:16:31 -0400
committerDarren Embry <dse@webonastick.com>2012-05-10 15:17:18 -0400
commit4dfd930ee9af1e9d98f3c41c51d9dec8c3bf34bb (patch)
tree4872b48538362ef518164b150f286c8b80296489 /etc
parentc9649cf848a723eb00b90ff3ce724d003912d3fc (diff)
downloadpfsense-4dfd930ee9af1e9d98f3c41c51d9dec8c3bf34bb.zip
pfsense-4dfd930ee9af1e9d98f3c41c51d9dec8c3bf34bb.tar.gz
cleanup: code for building arrays for autocompleted fields
Diffstat (limited to 'etc')
-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