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

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

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

View Answers

November 15, 2010 at 11:33 AM

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









Related Tutorials/Questions & Answers:
When are you supposed to use endif to end the conditional statement?
endif to end the conditional statement.
Advertisements
JavaScript Conditional Statements
ModuleNotFoundError: No module named 'when-will-it-end'
Conditional Examples(if - else- switch case) in JavaScript
When should you use Docker
Use if else and end statements in velocity
When would you use the Builder Pattern?
When would you use the Builder Pattern?
When should you use Hibernate?
PHP Conditional Statement
conditional statement in java
Should I use Protractor or Karma for my end-to-end testing?
When will you define a method as static?
extract data fom table when a button is clicked in front end page using mysql5.0 and tomcat6.0
Why we use Semicolon after SQL Statements?
Java Control Statements
i have developed the application in jsp(front-end -jsp,business logic-jsp).it is very slow when accessing the page - JSP-Servlet
PHP Control Statement
Java Control Statements
ModuleNotFoundError: No module named 'conditional'
Use Compound Statement in JSP Code
Use if statement with LOOP statement
cONDITIONAL STATEMENT
when to use ArrayList and when to use HashMap - Java Interview Questions
Conditional operator in java
Example for when to use ArrayList and when to use HashMap - Java Interview Questions
Decision-making Statements in java 7
Control Flow Statements in java 7
.When to use detached criteria in hibernate?
predicates and statements?
ModuleNotFoundError: No module named 'ec2_tag_conditional'
ModuleNotFoundError: No module named 'djangocms-conditional'
ModuleNotFoundError: No module named 'ec2_tag_conditional'
ModuleNotFoundError: No module named 'flask-conditional'
Java Write To File End Of Line
Looping Statements in java 7
Java error reached end of file while parsing
Identify correct and incorrect statements or examples about the purpose and use of EJB QL.
Conditional (Logical) Operators
Statements in JDBC - Java Interview Questions
Use if and elseif statements in velocity
Branching Statements in java 7
ModuleNotFoundError: No module named 'odoo12-addon-base-conditional-image'
ModuleNotFoundError: No module named 'coverage-conditional-plugin'
ModuleNotFoundError: No module named 'django-conditional-aggregates'
ModuleNotFoundError: No module named 'django-conditional-views'
Conditional Statement in Turbo C
Conditional Statement in Turbo C
When you look back on the position you held last, do you think you have done your best in it?

Ads