Parse PHP for the current url and domain name implementation code

  • 2020-06-15 07:58:03
  • OfStack


<?
// Gets the current domain name :
echo $_SERVER['SERVER_NAME'];
// Access to source website , That is, click to the page on the web site 
echo $_SERVER["HTTP_REFERER"];
$_SERVER['REQUEST_URI'];// Gets the suffix for the current domain name 
$_SERVER['HTTP_HOST'];// Get current domain name 
dirname(__FILE__);// Gets the physical path of the current file 
dirname(__FILE__)."/../";// Gets the top of the current file 1 Level physical path 
?>

Related articles: