In this video you will learn about nested if else statement in php.
Nested if else in PHP
• When we use an if else inside another if else then it is called as nested if else statement.
• Nested if else is used when we want to execute statement(s) among from several statement(s) after checking a set of conditions.
• Its general syntax is as follows:
• If(condition)
{ if(condition)
{ statements;
}
else
{ statements;
}
}
else
{ if(condition)
{ statements;
}
else
{ statements;
}
}
•Alternatively you can also use following syntax of nested if else
if(condition):
if(condition):
//code to be executed when condition is true
else:
//code to be executed when condition is false
endif;
else:
if(condition):
//code to be executed when condition is true
else:
//code to be executed when condition is false
endif;
endif;
www.tarunsir.com
www.cinstitute.org.in
Learn C Language from beginning
• C Language tutorial complete
Learn C++ from beginning
• C++ tutorial in hindi
Learn Java from beginning
• Java tutorial in hindi
Learn Python from beginning
• Python full course
Learn PHP from beginning
• PHP tutorial
Connect me on linkedin / tarrunverrma
/ the_ultimate_coding_stuff
#tarunsir #phptutorial #learnprogramming #php #ifelse #condition #nested