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
You can use parse_str() function.
$url = "www.mysite.com/register/?email=admin"; $parts = parse_url($url); parse_str($parts['query'], $query); echo $query['email'];