From 229721a6235f62a0d04a583cbf09bcbb0e216647 Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Mon, 1 Sep 2014 16:55:52 +0200 Subject: reverse function of U() --- it_url.class | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'it_url.class') 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; +} + } ?> -- cgit v1.2.3