PHP gets the current full URL address function, PHP gets the current url_php tutorial

Source: Internet
Author: User

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 ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.