开发者

Get php self and GET variables

开发者 https://www.devze.com 2023-01-22 12:59 出处:网络
$from = $_SERVER[\'REQUEST_URI\']; echo /marketing/clients.php?action=sendbook&issue=29 How to get clients.php?action=sendbook&issue=29 only?开发者_开发百科
$from = $_SERVER['REQUEST_URI'];

echo /marketing/clients.php?action=sendbook&issue=29

How to get clients.php?action=sendbook&issue=29 only?开发者_开发百科 Thank you!


$temp = explode("/",$from);
$temp = end($temp);

or even easier

basename($from);


 echo $_SERVER['SCRIPT_NAME']."?".$_SERVER['QUERY_STRING'];
 // or (if you have to use $from)
 $from = $_SERVER['REQUEST_URI'];
 $url = parse_url($from);
 echo $url['path']."?".$url['query'];
 //or
 $url = explode("/",$from);
 echo $url[1];
0

精彩评论

暂无评论...
验证码 换一张
取 消