title: Filter for many option
body: <p>I have Input Variable :</p>
  
  <pre><code>$var_in="PDF Is from Adobe Acrobat";
  </code></pre>
  
  <p>i will strsub() 3 first and only get "PDF"</p>
  
  <pre><code>$key_is=substr($var_in,0,3);
  </code></pre>
  
  <p>I have some Main option, if found from $key_is</p>
  
  <p>1.Option one with items :</p>
  
  <pre><code>"PDF", "XML", "XLS", "DOC"
  </code></pre>
  
  <p>will run somefunction1()</p>
  
  <p>2.Option Two</p>
  
  <pre><code>"PNG", "BMP", "JPG"
  </code></pre>
  
  <p>run somefunction2()</p>
  
  <p>3.Option Three</p>
  
  <pre><code>"DAT", "BAC", "SQL"
  </code></pre>
  
  <p>run somefunction3()</p>
  
  <p>old ways is using </p>
  
  <pre><code>switch ($key_is) {
      case "PDF":
          runfunction1();
      break;
      case "DAT":
          runfunction3();
      break;
  ...
  }
  </code></pre>
  
  <p>how can make it simple (Maybe some function)? 
  if i add new items from main option is automatic goes to<br>
  suitable Function option selection.</p>
  
  <p>like this, if i add "GIF" from main Option</p>
  
  <pre><code>"PNG", "BMP", "JPG", "GIF"
  </code></pre>
  
  <p>will run runfunction1()
  without i need change the switch</p>