Get current Domain URL in PHP
I have my site on server
http://www.myserver.uk.com
For this i have two domain:
http://one.com
and
http://two.com
i would like get with PHP current domain, but if I use
$_SERVER['HTTP_HOST']
then this show memyserver.uk.com
instead of:
one.com or two.com
How can i get domain, not the server name? I have PHP version 5.2
Answer :
try using this:
$_SERVER['SERVER_NAME']
EDIT:
or parse $_SERVER['REQUEST_URI']
COMMENTS