I want to get a domain name from a url but not the host domain. I'm looking to get the second in the example below so I'm looking for thisdomain.com
http://www.test.com?url=http://www.thisdomain.com/page01.html
Normally I'd use something like parse_url($url, PHP_URL_HOST) if I wanted test.com but if I use parse_url and [query] to try and get the second domain I get url=http://www.thisdomain.com/page01.html
Any ideas on what's the best way to do this?