diff options
author | Urban Müller | 2014-09-01 16:55:52 +0200 |
---|---|---|
committer | Urban Müller | 2014-09-01 16:55:52 +0200 |
commit | 229721a6235f62a0d04a583cbf09bcbb0e216647 (patch) | |
tree | 19f0233f1022a1623c2f26d50bdd335d49c4d273 /it_url.class | |
parent | 02389eb2bdc9ffaf232039a766e274c1ac4e9d91 (diff) | |
download | itools-229721a6235f62a0d04a583cbf09bcbb0e216647.tar.gz itools-229721a6235f62a0d04a583cbf09bcbb0e216647.tar.bz2 itools-229721a6235f62a0d04a583cbf09bcbb0e216647.zip |
reverse function of U()
Diffstat (limited to 'it_url.class')
-rw-r--r-- | it_url.class | 13 |
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; +} + } ?> |