You are here

function cc::http_serialize_params in Constant Contact 6.2

* This method takes care of escaping the values sent with the http request * *

Parameters

array An array of params to escape: * @param array The HTTP method eg. GET * * @access private

1 call to cc::http_serialize_params()
cc::http_send in ./class.cc.php
* This does most the work of creating the HTTP request * *

File

./class.cc.php, line 1736

Class

cc
@file

Code

function http_serialize_params($params) {
  $query_string = array();
  if (is_array($params)) {
    foreach ($params as $key => $value) {
      if (is_array($value)) {
        foreach ($value as $k => $fieldvalue) {
          $query_string[] = urlencode($key) . '=' . urlencode($fieldvalue);
        }
      }
      else {
        $query_string[] = urlencode($key) . '=' . urlencode($value);
      }
    }
  }
  else {
    return $params;
  }
  return implode('&', $query_string);
}