public function refreshResponseHeaders() { // clear old headers self::$aResponseHeaders = array(); // use the apache function, if possible if (function_exists('apache_response_headers')) { self::$aResponseHeaders = apache_response_headers(); } else { $aHeaderList = headers_list(); foreach ($aHeaderList as $sHeader) { $aHeader = explode(':', $sHeader); self::$aResponseHeaders[$aHeader[0]] = trim($aHeader[1]); } } }