In PHP, how can I check if the current page has www in the url or not?
E.g if the user is on http://www.example.com/something , how can I find that there\'s www in t
From the manual
$_SERVER['HTTP_HOST']
Contents of the Host: header from the current request, if there is one.
$_SERVER['SERVER_NAME']
The name of the server host under which the current script is executing. If the script is running on a virtual host, this will be the value defined for that virtual host.