All pastes #428963 Raw Edit

Something

public text v1 · immutable
·published 2007-04-07 23:13 UTC
rendered paste body
###
# Control Structures
###
These include if, for, while, switch, etc. Here is an example if statement,
since it is the most complicated of them:

<?php
if ((condition1) || (condition2)) {
    action1;
} elseif ((condition3) && (condition4)) {
    action2;
} else {
    defaultaction;
}
?>

Control statements should have one space between the control keyword and opening
parenthesis, to distinguish them from function calls.

For switch statements:

<?php
switch (condition) {
    case 1:
        action1;
    break;

    case 2:
        action2;
    break;

    default:
        defaultaction;
    break;
}
?>