title: In PHP, is there a short way to compare a variable to multiple values?
body: <p>Basically what I'm wondering if there is a way to shorten something like this:</p>
  
  <pre><code>if ($variable == "one" || $variable == "two" || $variable == "three")
  </code></pre>
  
  <p>in such a way that the variable can be tested against or compared with multiple values without repeating the variable and operator every time.</p>
  
  <p>For example, something along the lines of this might help:</p>
  
  <pre><code>if ($variable == "one" or "two" or "three")
  </code></pre>
  
  <p>or anything that results in less typing.</p>