开发者

Get php self and GET variables

$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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜