iSelfSchooling.com  Since 1999     References  |  Search more  | Oracle Syntax  | Free Online Oracle Training

    Home      .Services     Login       Start Learning     Certification      .                 .Share your BELIEF(s)...

 

. Online Accounting        .Copyright & User Agreement   |
    .Vision      .Biography     .Acknowledgement

.Contact Us      .Comments/Suggestions       Email2aFriend    |

 

How to do control structures in PHP?

How to do control structures in PHP?


IF statement.
if (condition) 
{
Statement(s);
}

Or
if (condition) 
{
Statement(s);
} else
{
Statement(s);
}

Or 

if (condition) 
{
Statement(s);
} elseif (condition)
{
Statement(s);
}

The Switch Conditional:
switch ($variable) {
case “value”:
statement(s);
break;
case “value”:
statement(s);
break;
default
statement(s);
break;
}

The loop condition:
for (initial expression; condition; closing expression) {
statement(s);
}

while (condition) {
statement(s);
}

do {
statement(s);
} while (condition);

foreach ($array) {
statement(s);
}

 

 

Google
 
Web web site