In pervious tutorial I was told you how to parse URL, Now I want to share next steps, how to parse query string in PHP. In Previous tutorial you have below Array.
1 2 3 4 5 6 7 8 9 10 11 12 13
Array
(
[scheme] => https
[host] => graph.facebook.com
[path] => /xxxxxx/feed
[query] => limit=400&until=1353532418
)
If you want to get out until parameter value, how to do it, first one option we will use explode() function second one we use PHP inbuilt simple parse_str() method.
1 2 3 4 5 6 7 8 9 10 11
$nexUrl = 'https://graph.facebook.com/xxxxxx/feed?limit=400&until=1353532418';
$parseURL = parse_url($nexUrl);
echo "<pre>";
print_r($parseURL);
parse_str($parseURL['query']);
echo 'limit='. $limit .'<br/> until='.$until;
Result:
