GENWiki

Premier IT Outsourcing and Support Services within the UK

User Tools

Site Tools


php:get_headers_from_curl_response
function get_headers_from_curl_response($headerContent) {
 
    $headers = array();
    $arrRequests = explode("\r\n\r\n", $headerContent);
    for ($index = 0; $index < count($arrRequests) -1; $index++) {
    	foreach (explode("\r\n", $arrRequests[$index]) as $i => $line)
    	{
    		if ($i === 0)
    			$headers[$index]['http_code'] = $line;
    		else
    		{
    			list ($key, $value) = explode(': ', $line);
    			$headers[$index][$key] = $value;
    		}
    	}
    }
    return $headers;
}
/home/gen.uk/domains/wiki.gen.uk/public_html/data/pages/php/get_headers_from_curl_response.txt · Last modified: 2019/05/20 10:17 by genadmin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki