What ‘Control Structures’ are available through PHP and how do they work?

PHP provides most basic control structures seen in other languages, among them the looping constructs for and while, and the standard if/else construct. Examples are given below:

    // for Loop Example
    for ($i = 0; $i <= 10; $i++) {
        echo "Current Iteration: $in";
    }

    // while Loop Example
    $i = 0;
    while ($i <= 10) { echo "Current Iteration: $in"; $i++; } // if/elseif/else Example if ($i >20) {
        echo "$i is greater than 20.n";
    } elseif ($i >10) {
        echo "$i is greater than 10.n";
    } else {
        echo "$i is less than 10.n";
    }
    ?>