I’m using cURL to return data from external sites. How can I return the base URL of a site with PHP?
For example, I have this URL:
http://www.bestbuy.com/site/Insignia%26%23153%3B+-+55%22+Class+/+1080p+/+120Hz+/+LCD+HDTV/2009148.p?id=1218317000232&skuId=2009148
I just want http://www.bestbuy.com
Thanks!
//Would give you
Array
(
[scheme] => http
[host] => www.bestbuy.com
[path] => /site/Insignia%26%23153%3B+-+55%22+Class+/+1080p+/+120Hz+/+LCD+HDTV/2009148.p
[query] => id=1218317000232&skuId=2009148
)