Home > Backend Development > PHP Tutorial > 我想用PHP $_SERVER['HTTP_HOST'] 获取当前服务器的域名,但是每次都转换成了IP地址?

我想用PHP $_SERVER['HTTP_HOST'] 获取当前服务器的域名,但是每次都转换成了IP地址?

WBOY
Release: 2016-06-06 20:35:58
Original
2626 people have browsed it

我想用PHP $_SERVER['HTTP_HOST'] 获取当前服务器的域名,但是每次都转换成了IP地址?

回复内容:

我想用PHP $_SERVER['HTTP_HOST'] 获取当前服务器的域名,但是每次都转换成了IP地址?

看官方文档上说,$_SERVER这个变量是web服务器提供的,所以建议检查一下web服务器的问题

另:http://blog.csdn.net/fz04003/article/details/6115247

请求的url是域名还是ip呢

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template