Like Us Like Us Facebook Subscribe Subscribe us YouTube Whatsapp Share us Whatsapp Query Send your queries

PHP Do While Tutorial with Working Example

PHP Do While Tutorial with Working Example

On reaching the control to do statement,
the program proceeds to evaluated the body of the loop first. At the
end of the loop, the test-condition in the while statement is
evaluated,so it is categorized as post tested loop.
The basic format of
do while() statement is:
body of the loop
}while(test-conditon);Lets have a working example
a program to enter a number and check entered number is Armstrong or Not (153 is a Armstrong number).

if(isset($_POST[‘b1’])) {
                                 $msg=”Not Armstrong”;
                <form action=”” method=”post”>
                Enter Number<input type=”text” name=”t1″><br>
                Status<input type=”text” value=”<?php echo $msg;?>”><br>
                <input type=”submit” name=”b1″ value=”Check”>

0 0 votes
Article Rating
Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Inline Feedbacks
View all comments