src/http/HeaderCollection.php
public function fromArray(array $array)
    {
        $this->removeAll();
        foreach ($array as $name => $values) {
            if (\is_array($values)) {
                foreach ($values as $value) {
                    $this->add($name, $value);
                }
            } else {
                $this->add($name, $values);
            }
        }
    }
public function fromArray(array $array)
    {
        $this->removeAll();
        foreach ($array as $name => $values) {
            if (\is_array($values)) {
                foreach ($values as $value) {
                    $this->add($name, $value);
                }
            } else {
                $this->add($name, $values);
            }
        }
    }
public function fromArray ( array $ array ) { $ this -> removeAll ( ) ; foreach ( $ array as $ name => $ values ) { if ( \ is_array ( $ values ) ) { foreach ( $ values as $ value ) { $ this -> add ( $ name , $ value ) ; } } else { $ this -> add ( $ name , $ values ) ; } } }
Populates the header collection from an array.
@param array $array the headers to populate from
@since 2.0.3
Populates the header collection from an array .