give error if number is anything other than 1 or 0
<pre><code>&lt;?php
$gender = 0;
if (($gender != 0) || ($gender != 1))
{
    die('error:Must select a gender.');
}
?&gt;
</code></pre>

<p>This should give a error if the gender is anything other than <code>1</code> or <code>0</code>. So if i gave <code>5</code> it should die. If i gave it <code>1</code> it should not die. If i give it <code>0</code> it should not die.</p>

<p>I was thinking about a few work arounds</p>

<pre><code>&lt;?php
$gender = 0;
if ($gender == 0)
{
//number is okay
}
else if ($gender == 1)
{
//number is okay
}
else
{
die('error:Must select a gender.');
}
?&gt;
</code></pre>

<p>Well that looks sloppy and it would work or i could create a array with 0 and 1 and check if its in it or not. Kinda overkill i think.</p>

<p>Not sure what i'm doing wrong.</p>
