Saturday, October 6, 2012

While loop in php examples



//  How to use while loop in php.


Syntax

while (condition)
{
    code to be executed;
}
 
 
<?php
// print  1 to 5  
$a=1;
while ($a<=5)
{
echo "\t ".$a;
$a=$a+1;
 
} 
 
?> 

No comments:

Post a Comment