mixed
http\Message::getHeader(string
$header[, string
$into_class = NULL
])Retrieve a single header, optionally hydrated into a http\Header extending class.
string
$header#string
$into_class# = NULL
mixed
, the header value if $into_class is NULL
.
<?php
class hdr extends http\Header {
function __construct($name, $value) {
var_dump($name, $value);
parent::__construct($name, $value);
}
}
$msg = new http\Message("Foo: bar");
$msg->getHeader("foo", "hdr");
?>
Yields:
string(3) "foo"
string(3) "bar"