0
我的网站就像?dir =/friends/pending,我想知道我是否可以得到字符串的“朋友”部分?PHP获取斜杠字符串的一部分
我尝试到目前为止
//I got the "pending" part by below...
$val = substr($_GET['a'], strrpos($_GET['a'], '/')+1);
//I tried getting "friends" with this but it didnt give me what i wanted..
$val2 = substr($_GET['a'], strrpos($_GET['a'], '/')- $val -2);
http://www.php.net/manual/en/ function.explode.php – CBroe