PHP While loop do over and over tasks as long as the specified condition is true.
Syntax:
while (condition){
// to do
}
This blog supports beginners to get deep knowledge about programming in HTML, CSS, JavaScript, php, asp and other Web technologies and VB, VB.net, Java,step by step from the beginning. All the programming Concepts discuss with simple examples for the readability. Try out daily uploaded lessons to be a Programmer.
PHP - Switch Statement
Switch statement uses to perform different actions based on the different conditions of same variable at once. It takes one variable as an input and then check different conditions setup for switch statement. It acts like a set of if statements define for a variable.
Syntax:
switch (<variable>){
case <label 1>:
{code to be executed if the variable is label 1};
break;
case <label 2>:
{code to be executed if the variable is label 2};
break;
default:
{code to be executed if the variable is not equal to above labels};
break;
}
Subscribe to:
Posts (Atom)