title: Switch case for array combination
body: <p>I've written a switch which needs to match any combinations in the predefined array but now its matching only if all the combination from the given array is succeeded. But I want to match any combination from the array.</p>
  <p>example : if my combination consists only <code>'man','cisman'</code> then also my combination needs to succeed and needs to return <code>$result = &quot;male.png&quot;;</code>. But if any item otherthan the given combination needs to rejected and needs to return default case.</p>
  <p><a href="http://sandbox.onlinephpfunctions.com/code/f086dbb072fe893be6ab551eb3115d94afccedba" rel="nofollow noreferrer">Working demo</a></p>
  <pre><code>$menCombo = ['man','cisman','transmasculine','transman'];
  $womanCombo = ['woman','ciswoman','transfeminine','transwoman'];
  
              switch($genderdetail) {
                  case count(array_intersect($menCombo, $genderdetail)) === count(($menCombo)):
                  case &quot;man&quot;:
                  case &quot;cisman&quot;:
                  case &quot;transman&quot;:
                  case &quot;transmasculine&quot;:{
                      $result = &quot;male.png&quot;;
                      break;
                  }
                  case count(array_intersect($womanCombo, $genderdetail)) === count(($womanCombo)):
                  case &quot;woman&quot;:
                  case &quot;ciswoman&quot;:
                  case &quot;transfeminine&quot;:
                  case &quot;transwoman&quot;:{
                      $result = &quot;female.png&quot;;
                      break;
                  }
                  default: {
                      $result = &quot;others.png&quot;;
                      break;
                  }
              }
  </code></pre>