Website domain name PHP get the website domain name and address code

Source: Internet
Author: User
Copy the Code code as follows:


function pma_getenv ($var _name) {
if (Isset ($_server[$var _name])) {
return $_server[$var _name];
} elseif (Isset ($_env[$var _name])) {
return $_env[$var _name];
} elseif (getenv ($var _name)) {
Return getenv ($var _name);
} elseif (Function_exists (' apache_getenv ')
&& apache_getenv ($var _name, True)) {
Return apache_getenv ($var _name, true);
}
Return ';
}
if (Empty ($HTTP _host)) {
if (pma_getenv (' Http_host ')) {
$HTTP _host = pma_getenv (' http_host ');
} else {
$HTTP _host = ";
}
}
Echo htmlspecialchars ($HTTP _host);
?>

The above introduces the website domain name of PHP to obtain the website domain name and address of the code, including the site domain name record content, I hope that the PHP tutorial interested friends have helped.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.