Equivalence of Looping Structures
This lesson explains how we can covert a for loop into a while loop.
We'll cover the following...
For loop #
An example of for
loop is given below:
Press + to interact
<?php$i;for ($i = 0;$i < 10;$i++){$i = $i * 2;echo "Value of i is: $i\n";}echo "Final value of i is: $i\n";?>