protected function smashHeaders($headers) {

    if (empty($headers)) {
      return;
    }

    $buffer = array();
    foreach ($headers as $name => $value) {
      // $buffer[] = sprintf("%s: %s", $name, urlencode($value));
      $buffer[] = sprintf("%s: %s", $name, $value);
    }
    $headerStr = implode("\r\n", $buffer);

    return $headerStr . "\r\n";
  }
protected function smashHeaders($headers) {

    if (empty($headers)) {
      return;
    }

    $buffer = array();
    foreach ($headers as $name => $value) {
      // $buffer[] = sprintf("%s: %s", $name, urlencode($value));
      $buffer[] = sprintf("%s: %s", $name, $value);
    }
    $headerStr = implode("\r\n", $buffer);

    return $headerStr . "\r\n";
  }
protected function smashHeaders ( $ headers ) { if ( empty ( $ headers ) ) { return ; } $ buffer = array ( ) ; foreach ( $ headers as $ name => $ value ) { // $buffer[] = sprintf("%s: %s", $name, urlencode($value)); $ buffer [ ] = sprintf ( "%s: %s" , $ name , $ value ) ; } $ headerStr = implode ( "\r\n" , $ buffer ) ; return $ headerStr . "\r\n" ; }
Given an array of headers, build a header string.

This builds an HTTP header string in the form required by the HTTP stream
wrapper for PHP.

@param array $headers
An associative array of header names to header values.
@retval string
@return string
A string containing formatted headers.
Given an array of headers build a header string .