
When are you supposed to use endif to end the conditional statement?

Hi all,
When the original if was followed by : and then the code block without braces.
Example:
<?php
if ($username == "deepak"):
echo "User Name is deepak.";
elseif ($username == "kumar"):
echo "User Name is kumar.";
else:
echo "wrong user name";
endif;
?>
Thanks
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.