title: Best practice on ending if...else statement without else condition
body: <p>What is the best practice to end an if...else statement without an else condition? Consider the following code:</p>
  
  <pre><code>$direction = $_POST['direction']; //Up or down
  
  if ($direction == "up") {
    code goes here...
  }
  
  elseif ($direction == "down") {
    code goes here...
  }
  
  else {
    //do nothing?
  }
  </code></pre>
  
  <p>As you can see, there's only 2 condition; either up or down and the else statement doesn't really have a purpose unless you want it to display an error message.</p>
  
  <p>Most of the time I see programmers simply put the else condition there but inserts a comment instead of any working code like this.</p>
  
  <pre><code>else {
        //error messages goes here...
  }
  </code></pre>
  
  <p>or just assume if it's not 'up' then everything else should be 'down' since there's only 2 condition. If a user inputs 'left' or 'right', it would still be considered as 'down'. I think this is somewhat inappropriate.</p>
  
  <pre><code>if ($direction == 'up') {
    code goes here...
  }
  
  else {
    code goes here...
  }
  </code></pre>
  
  <p>I know that PHP would still work if we put if without else condition. But what if there is an elseif condition? In cases like these, what is the best practice if we want to maintain a strict if...else statement if we do not want to include any error messages or have any else conditions?</p>
  
  <p>Thanks in advance.</p>