PHP gets the current full URL address of the function, PHP gets the current URL
Here is mainly to share a very useful PHP function, the code is very simple, there is no more nonsense, the small partners need to use the words directly.
Copy the Code code as follows:
PHP gets the full URL address of the current access
function Get_current_url () {
$current _url= ' http://';
if (isset ($_server[' https ") &&$_server[' https ']== ' on ') {
$current _url= ' https://';
}
if ($_server[' server_port ']!= ' 80 ') {
$current _url.=$_server[' server_name ']. ': '. $_server[' server_port '].$_server[' Request_uri '];
}else{
$current _url.=$_server[' server_name '].$_server[' Request_uri '];
}
return $current _url;
}
http://www.bkjia.com/PHPjc/930487.html www.bkjia.com true http://www.bkjia.com/PHPjc/930487.html techarticle PHP Gets the current full URL address of the function, PHP get the current URL here is mainly to share a very useful PHP function, the code is very simple, there is no more nonsense, the little friends need ...