$from = $_SERVER['REQUEST_URI'];
echo /marketing/clients.php?action=sendbook&issue=29
如何仅获得clients.php?action=sendbook&issue=29
?
谢谢!
答案 0 :(得分:3)
$temp = explode("/",$from);
$temp = end($temp);
甚至更容易
basename($from);
答案 1 :(得分:1)
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];