note 121720 deleted from function.parse-url by cmb
| From: | cmb@php.net | Date: | Sun, 08 Sep 2019 10:32:30 +0000 |
| Subject: | note 121720 deleted from function.parse-url by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-212147@lists.php.net to get a copy of this message | ||
Note Submitter: jdael
----
To get the params (url query) as Associative array, use this function:
<?php
/**
* Returns the url query as associative array
*
* @param string query
* @return array params
*/
function convertUrlQuery($query) {
$queryParts = explode('&', $query);
$params = array();
foreach ($queryParts as $param) {
$item = explode('=', $param);
$params[$item[0]] = $item[1];
}
return $params;
}
?>
https://forum.jdael.net/