public function _headerfunction($ch, $str)
{
$header = trim($str);
// don't save blank lines we might be handed - there's usually one after the headers
if ($header != '') {
// break the header up into field and value
$pieces = explode(': ', $header, 2);
if (count($pieces) > 1) {
// if the header was a key: value format, store it keyed in the array
$this->headers[$pieces[0]] = $pieces[1];
} else {
// some headers (like the HTTP version in use) aren't keyed, so just store it keyed as itself
$this->headers[$pieces[0]] = $pieces[0];
}
}
return strlen($str);
}