drupal_query_string_encode

Versions
5 – 6
drupal_query_string_encode($query, $exclude = array(), $parent = '')

Parse an array into a valid urlencoded query string.

Parameters

$query The array to be processed e.g. $_GET

$exclude The array filled with keys to be excluded. Use parent[child] to exclude nested items.

$parent Should not be passed, only used in recursive calls

Return value

urlencoded string which can be appended to/as the URL query string

▾ 21 functions call drupal_query_string_encode()

apachesolr_l in contributions/apachesolr/apachesolr.module
A replacement for l()
apachesolr_search_form_search_submit in contributions/apachesolr/apachesolr_search.module
Added form submit function to account for Apache mode_rewrite quirks.
calendar_ical_views_feed_argument in contributions/calendar/calendar_ical.module
feed argument hook that will convert us to ical or display an icon. the 4th argument isn't part of the hook, but we use it to differentiate when called as a hook or when called manually from calendar_ical_views_post_view
date_querystring in contributions/date/date_api.module
Pick up filter and sort info from url.
date_views_querystring in contributions/date/includes/date_api.views.inc
drupal_get_destination in 5/includes/common.inc
Prepare a destination query string for use in combination with drupal_goto(). Used to direct the user back to the referring page after completing a form. By default the current URL is returned. If a destination exists in the previous request, that…
drupal_query_string_encode in 5/includes/common.inc
Parse an array into a valid urlencoded query string.
globalredirect_init in contributions/globalredirect/globalredirect.module
Implementation of hook_init().
i18n_block in contributions/i18n/i18n.module
Language block
pager_get_querystring in 5/includes/pager.inc
Compose a query string to append to pager requests.
project_issue_advanced_search in contributions/project_issue/issue.inc
handles the advanced search form
project_issue_quick_search in contributions/project_issue/issue.inc
Handles quick search form
securepages_form_alter in contributions/securepages/securepages.module
Implementation of hook_form_alter()
securepages_goto in contributions/securepages/securepages.module
securepage_goto()
tablesort_get_querystring in 5/includes/tablesort.inc
Compose a query string to append to table sorting requests.
theme_pager_link in 5/includes/pager.inc
Format a link to a specific query result page.
translation_block in contributions/i18n/translation/translation.module
Implementation of hook_block().
uc_store_send_report in contributions/ubercart/uc_store/uc_store.module
views_bonus_audio_view in contributions/views_bonus/views_bonus_audio_playlist.module
views_rss_views_feed_argument in contributions/views/views_rss.module
feed argument hook that will convert us to RSS or display an icon. the 4th argument isn't part of the hook, but we use it to differentiate when called as a hook or when called manually from views_rss_views_post_view
_swftools_get_flashvars_string in contributions/swftools/swftools.module
"flashvars" is a parameter like height and width, which are passed into the flash player as a=1&b=2&...

Code

5/includes/common.inc, line 204

<?php
function drupal_query_string_encode($query, $exclude = array(), $parent = '') {
  $params = array();

  foreach ($query as $key => $value) {
    $key = drupal_urlencode($key);
    if ($parent) {
      $key = $parent .'['. $key .']';
    }

    if (in_array($key, $exclude)) {
      continue;
    }

    if (is_array($value)) {
      $params[] = drupal_query_string_encode($value, $exclude, $key);
    }
    else {
      $params[] = $key .'='. drupal_urlencode($value);
    }
  }

  return implode('&', $params);
}
?>