title: PHP $_POST, $_GET, or $_REQUEST
body: <p>I have a functions file where I handle POST and GETS letting the user perform either a post or a get.  It's more like an API call.</p>
  
  <p>Should I be doing it like this or would using $_REQUEST handle both a POST and a GET?</p>
  
  <pre><code>if ($_SERVER['REQUEST_METHOD'] === "GET") {
  
      $function = $_GET['f'];
      $user_id  = $_GET['user_id'];
  }
  elseif ($_SERVER['REQUEST_METHOD'] === "POST") {
  
      $function = $_POST['f'];
      $user_id  = $_POST['user_id'];
  }
  
  $res = new stdClass();
  
  if (isset($function)) {
  
      switch ($function) {    
           ....
      }
  }
  </code></pre>