HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
PHP Keywords : End an if conditional
The endif
keyword is used to mark the end of an if
conditional which was started with
the if(...):
syntax. It also applies to any variation of the if
conditional, such as
if...elseif
and if...else
.
The if keyword.
The else keyword.
The elseif keyword.
Read more about conditional statements in our PHP if else Tutorial.
End an if...else
conditional:
<?php
$a = 4;
if($a < 5):
echo "Less than five";
else:
echo "Greater than five";
endif;
?>
End an if...elseif...else
conditional:
<?php
$a = 4;
if($a < 5):
echo "Less than five";
elseif($a < 10):
echo "More than five but less than ten";
else:
echo "Greater than ten";
endif;
?>
❮ PHP Keywords