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