In PHP, how would I parse the following query string to get the entire variable "url" which should contain everything after it?
http://www.mydomain.com/?c=log&m=index&url=https://www.facebook.com/logout.php?next=http%3A%2F%2Fwww.anotherdomain.com&access_token=AAACPpB5pr5gBAJLFZBGaU6SM7UMlGQob7QUBf3aI0DIHrHWtcTGHirS0UrwwDDZBEiIQHeWfkOVCFbEXrFt6TdVlbPrXmV6xyPDI9pPQZDZD
$_GET['url'] drops everything after 'www.anotherdomain.com' because it encounters another '&'.
The problem is that 'url' is provided by Facebook. If I urlencode the entire string, it becomes invalid. How would I parse 'url' to programmatically urlencode only the piece that needs to be changed?