Short hand to do something like: if($variable == 1 || $variable == "whatever" || $variable == '492') .
php
Solution
You can use this shorthand, but keep in mind that it is less efficient that explicitly listing them all with or clauses:
if(in_array($variable, array(1, 'whatever', '492'))){ ... }
Also if you want to use `===` instead of `==` the equivalent is:
if(in_array($variable, array(1, 'whatever', '492'), TRUE)){ ... }
Problem
I find my self doing this type of `IF` statement allot. For example: ``` if($variable == 1 || $variable == "whatever" || $variable == '492') { ... } ``` Except for allot of the time, I am comparing the $variable to maybe 4-5 things, sometimes more. Is there a short hand way to write this? You can see that repeating `$variable ==` would get redundant. I would love for this to work, but it doesn't: ``` if($variable == (1 || "whatever" || 492) { ... } ```