shorter way to write if(x==1 || x==5 || x==7 || x==22)
<p>Programming in JavaScript and PHP, is there a shorter way to include several options in an if() condition?</p>

<p>I wonder if there is a way to write see a way to write for example</p>

<pre><code>if( myvar==1 || myvar==5 || myvar==7 || myvar==22 )
</code></pre>

<p>something like</p>

<pre><code>if( myvar==(1||5||7||22) )
</code></pre>

<p>Anyone knows a way to do this? Maybe regex?</p>
