summaryrefslogtreecommitdiff
path: root/it_url.class
diff options
context:
space:
mode:
Diffstat (limited to 'it_url.class')
-rw-r--r--it_url.class13
1 files changed, 13 insertions, 0 deletions
diff --git a/it_url.class b/it_url.class
index bf1e23f..e657fd3 100644
--- a/it_url.class
+++ b/it_url.class
@@ -823,6 +823,19 @@ static function _params($params, $keys = null)
return $result;
}
+/**
+ * Convert url into array with base url in $result[0] and GET params
+ * @param $paramsonly Only return GET params
+ */
+static function parse($url, $paramsonly = false)
+{
+ list($path, $query) = explode("?", $url);
+ if ($query)
+ parse_str($query, $params);
+
+ return ($paramsonly ? array() : array($path)) + (array)$params;
+}
+
}
?>