title: Use PHP $_GET[ for displaying different content in the same PHP file - is there another way to do it?
body: <p>Normally I use $_GET to catch the URL parameters and display content dependend on what the parameter is.</p>
  
  <pre><code>&lt;?php
  
  function isCmd($cmd) {
      if(isset($_GET["cmd"]))
          if($_GET["cmd"] == $cmd)
              return TRUE;
      return FALSE;
  }
  
  if(isCmd("page1")) {
      echo "&lt;p&gt;That is page 1&lt;/p&gt;";
  }
  else if(isCmd("page2")) {
      echo "&lt;p&gt;That is page 2&lt;/p&gt;";
  }
  else if(isCmd("page3")) {
      echo "&lt;p&gt;That is page 3&lt;/p&gt;";
  }
  else {
      echo "&lt;p&gt;That is the normal page&lt;/p&gt;";
  }
  </code></pre>
  
  <p>The url would look like these
  example.com/script.php<br>
  example.com/script.php?<strong>cmd=page1</strong><br>
  example.com/script.php?<strong>cmd=page2</strong><br>
  example.com/script.php?<strong>cmd=page3</strong><br></p>
  
  <p>And it works as expected, but I see on websites they can do just:<br>
  example.com/script.php?<strong>page1</strong><br>
  example.com/script.php?<strong>page2</strong><br>
  example.com/script.php?<strong>page3</strong><br>
  and it would work, without <em>cmd=</em></p>
  
  <p>How can I do the same in PHP?</p>