summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrban Müller2014-09-01 16:55:52 +0200
committerUrban Müller2014-09-01 16:55:52 +0200
commit229721a6235f62a0d04a583cbf09bcbb0e216647 (patch)
tree19f0233f1022a1623c2f26d50bdd335d49c4d273
parent02389eb2bdc9ffaf232039a766e274c1ac4e9d91 (diff)
downloaditools-229721a6235f62a0d04a583cbf09bcbb0e216647.tar.gz
itools-229721a6235f62a0d04a583cbf09bcbb0e216647.tar.bz2
itools-229721a6235f62a0d04a583cbf09bcbb0e216647.zip
reverse function of U()
-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;
+}
+
}
?>