 <p>Use a switch-statement.</p> <pre><code>switch($color) { case "blue": // do blue stuff break; case "yellow": // do yellow stuff break; case "red": // do red stuff break; default: // if everything else fails... } </code></pre> <p>In case you want to do the same thing on all colors, just use the <code>||</code> (boolean or) operator.</p> <pre><code>if ($color == "blue" || $color == "red" || $color == "yellow") { // do stuff } </code></pre>