function drupal_get_query_array
7.x common.inc | drupal_get_query_array($query) |
Splits a URL-encoded query string into an array.
Parameters
$query: The query string to split.
Return value
An array of URL decoded couples $param_name => $value.
Related topics
3 calls to drupal_get_query_array()
- locale_language_url_rewrite_session in drupal-7.x/
includes/ locale.inc - Rewrite URLs for the Session language provider.
- menu_edit_item_validate in drupal-7.x/
modules/ menu/ menu.admin.inc - Validate form values for a menu link being added or edited.
- system_update_7076 in drupal-7.x/
modules/ system/ system.install - Convert menu_links query strings into arrays.
File
- drupal-7.x/
includes/ common.inc, line 457 - Common functions that many Drupal modules will need to reference.
Code
function drupal_get_query_array($query) {
$result = array();
if (!empty($query)) {
foreach (explode('&', $query) as $param) {
$param = explode('=', $param);
$result[$param[0]] = isset($param[1]) ? rawurldecode($param[1]) : '';
}
}
return $result;
}