PHP Determining the current url

前端 未结 5 937
悲哀的现实
悲哀的现实 2021-01-13 15:15

I need to modify my function to return also the current folder I am in. Here is my current function:

function getLinkFromHost($url){  
    $port = $_SERVER[\         


        
5条回答
  •  鱼传尺愫
    2021-01-13 15:51

    Probably you also want to include get vars into your url, so you should add something to highphilosopher function...

    $current_url = rtrim(curPageURL(), "/").(!empty($_GET)) ? "?".http_build_query($_GET) : "";

提交回复
热议问题