summaryrefslogtreecommitdiff
path: root/it_url.class
diff options
context:
space:
mode:
authorChristian A. Weber2017-08-21 18:10:10 +0200
committerChristian A. Weber2017-08-21 18:10:10 +0200
commit34a0745e18910acd7f90a19dbd08ff03de2456bc (patch)
treedd64479ede7dd2176c8e51d6235a34b18003da1a /it_url.class
parent64791c69da32f7194e0cd673bb0cc70a74d33013 (diff)
downloaditools-34a0745e18910acd7f90a19dbd08ff03de2456bc.tar.gz
itools-34a0745e18910acd7f90a19dbd08ff03de2456bc.tar.bz2
itools-34a0745e18910acd7f90a19dbd08ff03de2456bc.zip
add it_url::parse_str() which leaves dots and spaces in arg names intact
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 b7ea7d7..5563b5e 100644
--- a/it_url.class
+++ b/it_url.class
@@ -824,6 +824,19 @@ static function _params($params, $keys = null)
return $result;
}
+
+static function parse_str($query)
+{
+ foreach (explode('&', $query, 2) as $arg)
+ {
+ list($key, $value) = explode("=", $arg, 2);
+ $result[urldecode($key)] = urldecode($value);
+ }
+
+ return (array)$result;
+}
+
+
/**
* Convert url into array with base url in $result[0] and GET params
*/