PHP 获取 URL 的一部分


PHP get a Part of the URL

我想从以下网址中获取直到的值,

https://graph.facebook.com/v2.1/168820059842589/feed?fields=id,from,message,comments%7Bfrom,id,created_time,message,attachment,comments%7Bfrom,id,created_time,message,attachment%7D%7D,type,created_time,updated_time,picture,name,caption,link,source,description,likes,story,place,story_tags&limit=250&include_hidden=true&until=1394190620&__paging_token=enc_AeyIp_kAzWE_u3avDbSjlT69EtTXCEOSDLyp0xSOTptJHfmlHKARfuTm197SkZAPDhKsXAtfu9G7jqzn75ymXK60UwG3nR2itFLk-IhY_hdOzQ

谢谢

您可以使用

parse_str()

$url = 'https://graph.facebook.com/v2.1/168820059842589/feed?fields=id,from,message,comments%7Bfrom,id,created_time,message,attachment,comments%7Bfrom,id,created_time,message,attachment%7D%7D,type,created_time,updated_time,picture,name,caption,link,source,description,likes,story,place,story_tags&limit=250&include_hidden=true&until=1394190620&__paging_token=enc_AeyIp_kAzWE_u3avDbSjlT69EtTXCEOSDLyp0xSOTptJHfmlHKARfuTm197SkZAPDhKsXAtfu9G7jqzn75ymXK60UwG3nR2itFLk-IhY_hdOzQ';
$arr = array();
parse_str($url,$arr);
echo $arr['until'];
//outputs 1394190620