Forum Moderators: coopster
Are there other ways to shorten this code so I can avoid multiple HTTP_HOST calls?
if ($_SERVER['HTTP_HOST'] == "example.com.sg") {
stuff here
}
elseif ($_SERVER['HTTP_HOST'] == "example.com.my") {
stuff here
}
else {
stuff here
}
I am thinking on the line of:
$browserurl = $_SERVER['HTTP_HOST'];
<a href="subdomain.'; $browserurl;'/subfolder/etc/">
I tried switch-case, but stuck on the same
I want to simplify it for the use of the none-techy editors of our news page, since I can't be available all the time :p
Thanks all!
[edited by: eelixduppy at 2:17 pm (utc) on July 16, 2007]
[edit reason] example.com [/edit]
Are there other ways to shorten this code so I can avoid multiple HTTP_HOST calls?if ($_SERVER['HTTP_HOST'] == "example.com.sg") {
stuff here
}
elseif ($_SERVER['HTTP_HOST'] == "example.com.my") {
stuff here
}
else {
stuff here
}
$ht_host = $_SERVER['HTTP_HOST'];
if ( $ht_host== "example.com.sg") {
stuff here
}
elseif ($ht_host == "example.com.my") {
stuff here
}
else {
stuff here
}
[edited by: eelixduppy at 2:19 pm (utc) on July 16, 2007]
[edit reason] example.com [/edit]