In php how do you say if ($x == 1 or 2 or 3 or 4) {do function} without repeating code many times?
<p>Im not great in php and I could do with a little help. I want to say something like</p>

<pre><code>if ($x == 1 or 2 or 3 or 4) {do function}
</code></pre>

<p>but the only way i know how to do that is to go</p>

<pre><code>if (($x == '1') or ($x == '2')) or...
</code></pre>

<p>which seems a long way of doing it. Is there a better way I am missing, like</p>

<pre><code>if ($x == 1,2,3,4) {do} 
</code></pre>

<p>Thanks for your answers!</p>
