Its does exactly what it says it ends the if, it tell the php parser; that the if (...): closes when endif; is declared. Example: <?php //start if statement... if ($username == "danx10") : //execute following code... echo "Hello ". $username; //end/close the if statement... endif; ?> PHP: As you can see from the above example it will execute everything between if(...): up until endif;
Check out here. It's used a lot in Wordpress because of the amount of HTML - it makes it easier to distinguish what blocks of code are ending rather than the ambiguous curly brace (which could be closing any block).