|
| $_SERVER['HTTP_HOST']
The $_SERVER['HTTP_HOST'] variable tells you the host name as per the http header.
Use as follows:
For http://somesite.com,
echo $_SERVER['HTTP_HOST'];
will return somesite.com
For http://www.somesite.com,
echo $_SERVER['HTTP_HOST'];
will return www.somesite.com
See also:
|
|