Best practice on ending if…else statement without else condition
问题 What is the best practice to end an if...else statement without an else condition? Consider the following code: $direction = $_POST['direction']; //Up or down if ($direction == "up") { code goes here... } elseif ($direction == "down") { code goes here... } else { //do nothing? } 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. Most of the time I see programmers simply put the else