aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/functions.inc.php')
-rw-r--r--include/functions.inc.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/include/functions.inc.php b/include/functions.inc.php
index c15149e20..df5b39e40 100644
--- a/include/functions.inc.php
+++ b/include/functions.inc.php
@@ -505,4 +505,38 @@ function redirect( $url )
exit();
}
+
+/**
+ * returns $_SERVER['QUERY_STRING'] whitout keys given in parameters
+ *
+ * @param array $rejects
+ * @returns string
+ */
+function get_query_string_diff($rejects = array())
+{
+ $query_string = '';
+
+ $str = $_SERVER['QUERY_STRING'];
+ parse_str($str, $vars);
+
+ $is_first = true;
+ foreach ($vars as $key => $value)
+ {
+ if (!in_array($key, $rejects))
+ {
+ if ($is_first)
+ {
+ $query_string.= '?';
+ $is_first = false;
+ }
+ else
+ {
+ $query_string.= '&';
+ }
+ $query_string.= $key.'='.$value;
+ }
+ }
+
+ return $query_string;
+}
?> \ No newline at end of file