|
|
|
|
|
|
|
|
|
#15 |
|
You can now put whatever you want in this space :)
|
Code:
function base_domain($url) { // parse out subdomains
$url = parse_url($url);
$host = $url['host'];
$pattern = "/([\-a-z0-9]*\.)?([\-a-z0-9]*)\.([a-z0-9]*)/i";
preg_match($pattern, $host, $matches);
$host = $matches[2] ."." .$matches[3];
return $host;
}
__________________
Success is going from failure to failure without a loss of enthusiasm. Last edited by Halfdeck; 2006-10-18 at 10:08 AM.. |
|
|
|
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|