function drupal_get_query_array

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()
FieldPluginBase::render_as_link in drupal/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php
Render this field as a link, with the info from a fieldset set by the user.
language_url_rewrite_session in drupal/core/modules/language/language.negotiation.inc
Rewrite URLs for the Session language negotiation method.
menu_edit_item_validate in drupal/core/modules/menu/menu.admin.inc
Validate form values for a menu link being added or edited.

File

drupal/core/includes/common.inc, line 464
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;
}