PHP Programs

Program for Elseif example

In this program demonstrate use of else-if statement to check multiple conditions.

Else-if ladder are flow controls statement in which block of code execute only if condition satisfy.




<title> Elseif...Example</title>






    echo"Have a nice weekend!";


    echo"Have a nice sunday!";


    echo"Have a nice day!";




When Run The Program Following Output:

Have a nice day!


In above program if today is Friday that time it prints "Have a nice weekend!" If day is Sunday then "Have a nice Sunday !" and if days other than Sunday and Friday then "Have a nice day!" will print on screen.

Releted Programs

© 2017 codewmAll rights reserved.