Grab the $SERVER_NAME environmental variable. Then parse the variable using
explode on the period in the domain name. Count the number of elements in
the array. and selcct the element you want to use
----- Original Message -----
From: "Liam MacKenzie" <[EMAIL PROTECTED]>
To: "php" <[EMAIL PROTECTED]>
Sent: Tuesday, September 10, 2002 8:55 PM
Subject: [PHP] subdomain
> G'day everyone,
> I have a dilemma...
> I'm running BIND locally, with a wildcard A record.
> That means that if someone goes to http://somebullshit.mydomain.com/
> get my page up.
> What I want to do is catch that subdomain into a variable... Is there a
> global that can get that?
> So, if someone goes to http://liam.mydomain.com/, the page will echo
> Any ideas guys?
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php