CodeIgniter -> Get current URL relative to base url

后端 未结 10 1207
情话喂你
情话喂你 2020-12-29 05:08

Tried URI::uri_string() but can\'t get it to work with the base_url.

URL: http://localhost/dropbox/derrek/shopredux/ahahaha/hihihi
Returns: dr

10条回答
  •  情书的邮戳
    2020-12-29 05:46

     //if you want to get parameter from url use:
     parse_str($_SERVER['QUERY_STRING'], $_GET);
     //then you can use:
     if(isset($_GET["par"])){
          echo $_GET["par"];
     }
     //if you want to get current page url use:
     $current_url = current_url();
    

提交回复
热议问题