PHP learn While Loop

This is simplest way to apply the loop . loops of code until the condition become true. See the example :

< ?php
while (expr):
    statement
    ...
endwhile;

?>
 

Example below define value $j = 1. The loop will repeat until the value of $j is equal to 3 or less than 3.

< ?php 
$i = 1;
while($i <= 3){
    $i++;
    echo "The number is " . $i . "
"
; } ?>



php-while-loop

   
See the video Example below to know More :

Last Updated: 2018-07-06 12:32:44 By akshay

SHARE THIS

share_facebook share_twitter share_google_plus

Please Comment Here :