$url = $_GET['url'];
// gets $url = http://www.facebook.com/UsedID
I want to explode url and get UserID only.
$userid = "UsedID";
echo "http://graph.facebook.com/$userid/picture ||";
I just Want to get The User Id.
$url = $_GET['url'];
// gets $url = http://www.facebook.com/UsedID
I want to explode url and get UserID only.
$userid = "UsedID";
echo "http://graph.facebook.com/$userid/picture ||";
I just Want to get The User Id.
$url = "http://www.facebook.com/UsedID";
$url = parse_url($url);
echo substr($url['path'], 1); //output: UsedID
$arr = explode('/', $url);
$userId = array_pop($arr);
$user = explode("/",$url);
$userid = $user[count($user)-1];
使用此代码:
$arr = explode("/", $url);
echo end($arr);
它将返回最后一个 url 中的用户 ID。