Wednesday, July 3, 2013
do while statement in PHP with example
<?php
$a=1;
while($a<=3)
{
echo " number is " . $a . "<br>";
$a++;
}
?>
Output:
Number is 1
Number is 2
Number is 3
<?php
$a=1;
do
{
$a++;
echo "The number is " . $a . "<br>";
}
while ($a<=3);
?>
Output:
Number is 2
Number is 3
Number is 4
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment