Created
October 10, 2014 06:49
-
-
Save dmshvetsov/8e4dddd0b87047755f82 to your computer and use it in GitHub Desktop.
A function for proprietary CMS that return
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function subsiteLink($subdomain = false) { | |
$ret = ''; | |
$hostAry = explode('.', SITE_HOST); | |
if (sizeof($hostAry) == 3 && in_array($subdomain, array('vl', 'lr'))) { | |
if ($subdomain) { | |
// return a link of the requested subdomain | |
$ret = implode('.', array($subdomain, $hostAry[1], $hostAry[2])); | |
} else { | |
// return a link of the main domain | |
$ret = implode('.', array($hostAry[1], $hostAry[2])); | |
} | |
} | |
return 'http://' . $ret; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment