Is there a better way to check for if domain then echo? Does this need to be closed out with a generic else, and at what point does this become resource intensive across a bunch of domains?
Thanks for your help!
Thanks for your help!
Code:
<?php
$host = $_SERVER['SERVER_NAME'];
if($host == "www.site.com" or $host == "site.com")
{ echo '<a href="http://site1.com">anchor 1</a> | <a href="http://site2.com">anchor 1</a> | <a href="http://site3.com">anchor 1</a>'; }
if($host == "www.site.com" or $host == "site.com")
{ echo '<a href="http://site1.com">anchor 2</a> | <a href="http://site2.com">anchor 2</a> | <a href="http://site3.com">anchor 2</a>'; }
if($host == "www.site.com" or $host == "site.com")
{ echo '<a href="http://site1.com">anchor 3</a> | <a href="http://site2.com">anchor 3</a> | <a href="http://site3.com">anchor 3</a>'; }
?>