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

php gets the current domain name and path

巴扎黑
Release: 2023-03-02 16:02:02
Original
1900 people have browsed it

$_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


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