I'm trying to condense my code to create less lines of PHP and was wondering if this is possible. Currently I have:
if ($_SERVER['HTTP_HOST']==domain1.com" ) {
down();
} elseif ($_SERVER['HTTP_HOST']=="domain2.com" ) {
down();
} else {
up();
}
?>
instead of having if
and elseif
displaying the same function, is it possible to do something like this:
if ($_SERVER['HTTP_HOST']==domain1.com" || $_SERVER['HTTP_HOST']=="domain2.com" ) {
down();
} else {
up();
}
?>
I tried the code above but my page went blank.. how do I do this if possible?