Parsing Domain From URL In PHP
- by zuk1
I need to build a function which parses the domain from a url.
So:
http://google.com/dhasjkdas/sadsdds/sdda/sdads.html
or
http://www.google.com/dhasjkdas/sadsdds/sdda/sdads.html
Would become "google.com" and
http://google.co.uk/dhasjkdas/sadsdds/sdda/sdads.html
would become "google.co.uk"