Home  >  Article  >  Backend Development  >  php gets the current domain name and path

php gets the current domain name and path

巴扎黑
巴扎黑Original
2016-12-01 09:59:221854browse

$_SERVER['REQUEST_URI'];//Get the suffix of the current domain name

$_SERVER['HTTP_HOST'];//Get the current domain name

dirname(__FILE__);//Get the physical path of the current file

dirname( __FILE__)."/../";//Get the upper-level physical path of the current file


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