Reputation: 3963
Given "http://google.com/path-to-page" trip to "google.com"
What php and regex would be appropriate?
Upvotes: 0
Views: 3176
Reputation: 523684
Use parse_url and get the host part.
host
Upvotes: 9