Home >Backend Development >PHP Tutorial >php gets the current domain name and path
$_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