public function setHeader($header) {
        if (is_array($header)) {
            foreach ($header as $v) {
                $this->setHeader($v);
            }
        } else {
            // Remove newlines, they are not allowed in headers.
            $newvalue = preg_replace('/[\r\n]/', '', $header);
            if (!in_array($newvalue, $this->header)) {
                $this->header[] = $newvalue;
            }
        }
    }
public function setHeader($header) {
        if (is_array($header)) {
            foreach ($header as $v) {
                $this->setHeader($v);
            }
        } else {
            // Remove newlines, they are not allowed in headers.
            $newvalue = preg_replace('/[\r\n]/', '', $header);
            if (!in_array($newvalue, $this->header)) {
                $this->header[] = $newvalue;
            }
        }
    }
public function setHeader ( $ header ) { if ( is_array ( $ header ) ) { foreach ( $ header as $ v ) { $ this -> setHeader ( $ v ) ; } } else { // Remove newlines, they are not allowed in headers. $ newvalue = preg_replace ( '/[\r\n]/' , '' , $ header ) ; if ( ! in_array ( $ newvalue , $ this -> header ) ) { $ this -> header [ ] = $ newvalue ; } } }
Set HTTP Request Header

@param array $header
Set HTTP Request Header