I am trying to parse url and extract value from it .My url value is www.mysite.com/register/?referredby=admin. I want to get value admin from this url.
www.mysite.com/register/?referredby=admin
admin
Try this code,
$url = "www.mysite.com/register/?referredby=admin"; $parse = parse_url($url, PHP_URL_QUERY); parse_str($parse, $output); echo $output['referredby'];