- explode: documentation ( source)
- parse_url: documentation ( source)
<?php
$url = 'http://username:password@hostname/path?arg=value&key=value2#anchor';
$ss_url_args = parse_url($url, PHP_URL_QUERY);
echo $ss_url_args;
$pieces = explode("&", $ss_url_args);
for($i = 0; $i < count($pieces); $i++)
{
$args = explode("=", $pieces[$i]);
if($args[0] === 'key')
{
$key = $args[1];
}
}
echo $key;