What is “endif; in PHP

endif is a tag and starting from “:” and closing tag is “endif;”

(Note:- Here “” not Included in code”)

endif tag same work as “{” and “}”

Example

<?php
$a=20;
$b=10;
if ($a > $b) {
echo "a is greater<br>";
}
?>
<?php
$a=20;
$b=10;
if ($a > $b) :
echo "a is greater<br>";
endif;
?>

Both Code Are Same Work

When i use in “if contions” for Multiple {}

Then we use “: endif;” tag for one of whole code, we can type “{}” tags inside “endif” tag