function fp_query_string_encode

7.x misc.inc fp_query_string_encode($query, $exclude = array(), $parent = '')
6.x misc.inc fp_query_string_encode($query, $exclude = array(), $parent = '')

Adapted from https://api.drupal.org/api/drupal/includes%21common.inc/function/drupal_...

File

includes/misc.inc, line 3019
This file contains misc functions for FlightPath

Code

function fp_query_string_encode($query, $exclude = array(), $parent = '') {
  $params = array();
  foreach ($query as $key => $value) {
    $key = rawurlencode($key);
    if ($parent) {
      $key = $parent . '[' . $key . ']';
    }
    if (in_array($key, $exclude)) {
      continue;
    }
    if (is_array($value)) {
      $params [] = fp_query_string_encode($value, $exclude, $key);
    }
    else {
      $params [] = $key . '=' . rawurlencode($value);
    }
  }
  return implode('&', $params);
}