如何从apache_request_headers()中提取主机(域);

How to extract the domain (host value) from the apache_request_headers(); output?

the original code:

$headers = apache_request_headers();
foreach ($headers as $header => $value) {
    echo "$header: $value <br />
";
}

the result:

Host: yatko.net 
Connection: keep-alive 
Cache-Control: max-age=0 
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36 
Accept-Encoding: gzip,deflate,sdch 
Accept-Language: en-US,en;q=0.8 

the desired output would be

yatko.net

I am having a strange issue with a mail form (http://goo.gl/Wr4sfC) and seems that apache_request_headers(); would work; however, I need to extract it from the generated array. Thank you!

You've answered your own question.

echo $headers['Host'];
// yatko.net