Home  >  Article  >  php教程  >  php获取当前域名:PHP获取当前网址 域名

php获取当前域名:PHP获取当前网址 域名

WBOY
WBOYOriginal
2016-06-21 08:51:131508browse

 
//获取当前的域名:
echo SERVER['SERVER_NAME'];//获取来源网址,即点击来到本页的上页网址
echo SERVER["HTTP_REFERER"];
SERVER['REQUEST_URI'];//获取当前域名的后缀
SERVER['HTTP_HOST'];//获取当前域名
dirname(__FILE__);//获取当前文件的物理路径
dirname(__FILE__)."/../";//获取当前文件的上一级物理路径
?>
本文链接http://www.cxybl.com/html/wlbc/Php/20121020/33083.html



Statement:
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
Previous article:LAMP乱码问题总结篇Next article:PHP 垃圾回收机制