private function createHeaders($headers)
    {
        if (is_string($headers)) {
            return $this->createHeaders(explode("\r\n", $headers));
        }

        $fixedHeaders = array();

        foreach ($headers as $key => $header) {
            if (is_int($key)) {
                if (($pos = strpos($header, ':')) === false) {
                    continue;
                }

                $fixedHeaders[substr($header, 0, $pos)] = substr($header, $pos + 1);
            } else {
                $fixedHeaders[$key] = $this->createHeader($header);
            }
        }

        return $fixedHeaders;
    }
private function createHeaders($headers)
    {
        if (is_string($headers)) {
            return $this->createHeaders(explode("\r\n", $headers));
        }

        $fixedHeaders = array();

        foreach ($headers as $key => $header) {
            if (is_int($key)) {
                if (($pos = strpos($header, ':')) === false) {
                    continue;
                }

                $fixedHeaders[substr($header, 0, $pos)] = substr($header, $pos + 1);
            } else {
                $fixedHeaders[$key] = $this->createHeader($header);
            }
        }

        return $fixedHeaders;
    }
private function createHeaders ( $ headers ) { if ( is_string ( $ headers ) ) { return $ this -> createHeaders ( explode ( "\r\n" , $ headers ) ) ; } $ fixedHeaders = array ( ) ; foreach ( $ headers as $ key => $ header ) { if ( is_int ( $ key ) ) { if ( ( $ pos = strpos ( $ header , ':' ) ) === false ) { continue ; } $ fixedHeaders [ substr ( $ header , 0 , $ pos ) ] = substr ( $ header , $ pos + 1 ) ; } else { $ fixedHeaders [ $ key ] = $ this -> createHeader ( $ header ) ; } } return $ fixedHeaders ; }
Creates the headers.

@param string|array $headers The headers.

@return array The created headers.
Creates the headers .