You are here

function cc::http_headers_to_s in Constant Contact 6.2

* This method converts an array of request headers into a correctly formatted HTTP request header * *

Parameters

array The array of headers to convert: * @return string A string that can be used within an HTTP request * * @access private

1 call to cc::http_headers_to_s()
cc::http_build_request_headers in ./class.cc.php
* This method calls other methods * It is mainly here so we can do everything in the correct order, according to HTTP spec * *

File

./class.cc.php, line 1876

Class

cc
@file

Code

function http_headers_to_s($headers) {
  $string = '';
  if (is_array($headers)) {
    foreach ($headers as $header => $value) {
      if (trim($header) != '' && !is_numeric($header)) {
        $string .= "{$header}: {$value}{$this->http_linebreak}";
      }
      else {
        $string .= "{$value}{$this->http_linebreak}";
      }
    }
  }
  return $string;
}