-2

this is my first time asking a question, so forgive me for anything wrong I say. I have been recently working a lot with php with some group members, and saw that one of them had put an "endif" statement. I asked my group member to explain what exactly that code does, but they didn't provide an explanation that helped me understand. If someone could give a brief explanation of what an "endif" statement does, I would be very grateful.

This is the code:

<?php  if (isset($_SESSION['username'])) : ?>
    <p>Hello! <strong><?php echo $_SESSION['username']; ?></strong>. Check your grades here.</p> 
<?php endif ?> `
treyBake
  • 6,440
  • 6
  • 26
  • 57
  • See the [documentation](https://www.php.net/manual/en/control-structures.alternative-syntax.php) – Barmar Oct 09 '19 at 16:24

1 Answers1

-1

When you do if condition in your code then you have to Complete the if condition with endif. like below.

if( Condition ) :
    // Your Statement
endif;
Krupal Panchal
  • 1,553
  • 2
  • 13
  • 26