Programming in JavaScript and PHP, is there a shorter way to include several options in an if() condition?
I wonder if there is a way to write see a way to write for example
if( myvar==1 || myvar==5 || myvar==7 || myvar==22 )
something like
if( myvar==(1||5||7||22) )
Anyone knows a way to do this? Maybe regex?
For javascript you can add all on a array and you can check that myvar is present in array or not by .indexOf