Complete the code to start a do-while loop in PHP.
<?php do [1] { echo "Hello"; } while (false);
The do keyword starts a do-while loop in PHP.
Complete the code to correctly write the condition part of a do-while loop.
<?php
do {
echo "Count: $i\n";
$i++;
} while ([1] < 5);The variable $i is used in the loop and should be checked in the condition.
Fix the error in the do-while loop syntax by completing the missing part.
<?php $i = 0; do { echo $i . "\n"; $i++; } [1] ($i < 3);
The while keyword must follow the do-block to complete the do-while loop syntax.
Fill both blanks to create a do-while loop that prints numbers 1 to 3.
<?php $i = 1; do { echo $i . "\n"; $i[1]1; } [2] ($i <= 3);
The variable $i is incremented with ++, and the loop ends with while keyword.
Fill all three blanks to create a do-while loop that prints even numbers from 2 to 6.
<?php $num = 2; do { echo $num . "\n"; $num [1] 2; } [2] ($num [3] 8);
The variable $num is increased by 2 using +=, the loop ends with while, and the condition checks if $num is less than 8.