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

4 calls to drupal_get_query_array()
FieldPluginBase::renderAsLink 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.
MenuLinkFormController::validate in drupal/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkFormController.php
Overrides EntityFormController::validate().
_contextual_id_to_links in drupal/core/modules/contextual/contextual.module
Unserializes the result of _contextual_links_to_id().

File

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