You are here

function follow_build_query in Follow 7.2

Same name and namespace in other branches
  1. 5 follow.module \follow_build_query()
  2. 6 follow.module \follow_build_query()
  3. 7 follow.module \follow_build_query()

Like drupal_http_build_query() but without urlencodings.

1 call to follow_build_query()
follow_build_url in ./follow.inc
Build a url for use in the form.

File

./follow.inc, line 149
Follow module API and helper functions.

Code

function follow_build_query(array $query, $parent = '') {
  $params = array();
  foreach ($query as $key => $value) {
    $key = $parent ? $parent . '[' . $key . ']' : $key;

    // Recurse into children.
    if (is_array($value)) {
      $params[] = follow_build_query($value, $key);
    }
    elseif (!isset($value)) {
      $params[] = $key;
    }
    else {
      $params[] = $key . '=' . $value;
    }
  }
  return implode('&', $params);
}