Reputation: 99
$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.
Upvotes: 0
Views: 109
Reputation: 76646
$url = "http://www.facebook.com/UsedID";
$url = parse_url($url);
echo substr($url['path'], 1); //output: UsedID
Upvotes: 3
Reputation: 15593
Use this code:
$arr = explode("/", $url);
echo end($arr);
it will return the userid that is in the last of url.
Upvotes: 0