Jump to content

[SOLVED] Grabbing part of a subdomain


stargate03

Recommended Posts

For a full list of the server strings you can get; put this in somewhere:

echo "<pre>";

print_r($_SERVER);

echo "</pre>";

 

You can find the most appropriate one (probably $_SERVER['SERVER_NAME']) and then if neccesary chop it up using explode:

e.g:

list($subdomain,$domain) = explode(".",$_SERVER['SERVER_NAME']);

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.