This works if 'test1' is in the url:
<? if(strpos($_SERVER['HTTP_HOST'], 'test1') !== FALSE) : ?>
<p>Do something</p>
<? else : ?>
<p>Do something else</p>
<? endif ?>
This doesn't work if 'test1' is in the url:
<? if(strpos($_SERVER['HTTP_HOST'], 'test1') OR strpos($_SERVER['HTTP_HOST'], 'test2') !== FALSE) : ?>
<p>Do something</p>
<? else : ?>
<p>Do something else</p>
<? endif ?>
Questions:
1. When I try to run the second option, php outputs "Do something else" every time - I know it's basic but why is this?
2.
Why doesn't == TRUE work in this instance, only !==FALSE works.
Any help would be much appreciated - I've spent a scary amount of time researching this so sorry if it's because of a dumb mistake.
Cheers