title: PHP getopt Operations
body: <p>This question is regarding getopt function in php. I need to pass two parameter to the php scripts like</p>
  
  <pre><code>php script.php -f filename -t filetype
  </code></pre>
  
  <p>Now depending upon the file type which can be u, c or s I need to do proper operation. </p>
  
  <p>I am using switch case for the same:</p>
  
  <p>Here is the Code I am using:</p>
  
  <pre><code>// Get filename of input file when executing through command line.
  $file = getopt("f:t:");
  </code></pre>
  
  <p>Switch case should compare the type of the file which I am passing in from the command line (u, c or i) and accordingly match it and do the operation. </p>
  
  <pre><code>switch("I am not sure what should go in there and this is wrong,Please advice")
      {
  
          case `Not sure`:
              $p-&gt;ini();
              break;
  
          case `Not sure`:
              $p-&gt;iniCon();
              break;
  
          case `Not sure`:
              $p-&gt;iniImp();
              break;
      }
  </code></pre>
  
  <p>Kindly advise on this !!!</p>