GET URL parameter in PHP

前端 未结 9 984
旧时难觅i
旧时难觅i 2020-11-22 07:32

I\'m trying to pass a URL as a url parameter in php but when I try to get this parameter I get nothing

I\'m using the following url form:

http://loc         


        
9条回答
  •  既然无缘
    2020-11-22 08:14

    The accepted answer is good. But if you have a scenario like this:

    http://www.mydomain.me/index.php?state=California.php#Berkeley
    

    You can treat the named anchor as a query string like this:

    http://www.mydomain.me/index.php?state=California.php&city=Berkeley
    

    Then, access it like this:

    $Url = $_GET['state']."#".$_GET['city'];
    

提交回复
热议问题