Comparing a variable to 2 values
<p>I have a variable <code>$var</code> which must be either <em>one</em> or <em>two</em> and if it's not then throw an error</p>

<pre><code>if($var != "one" &amp;&amp; $var != "two")
{
    exit('$var must be either one or two');
}
</code></pre>

<p>This works. However as <code>$var</code> is a string and can only hold one value not both, so I'm wondering if it's not logical to write like that?</p>
