ResumesInn
Welcome  ,
Interview Questions >> PHP >> When are you supposed to use endif to end the if statement?
Next Question Previous Question

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



  Joseph Ranjan wrote ...

When the original if was followed by : and then the code block without braces.

Ex.

<?php
if ($player == "Sachin"):
    echo
"Batsman Name is Sachin Ramesh Tendulkar.";
elseif
($player == "Sourav"):
    echo
"Batsman Name is Sourav Ganguly.";
else:
    echo
"Batsman Name not Found.";
endif
;
?>


Login to write answer for this question !
Want to place your ads in this website ?
50USD Per Month for single placement. Contact Us
All Rights Reserved . Developed by SJRANJAN