I'll call you back again to another video lecture in PHP.
And in this video lecture I'll go ahead and teach you about do while loop.
As I said in the previous lecture, we discussed about a while loop.
And in this video lecture we're going to talk about do while loop.
Now this is what we did in the previous lecture.
We actually did this.
And when you run this code it gives you this.
What is defined between while loop and do while loop is that in while loop we always check the condition
which is this before we execute and go back and check the condition.
But in do while loop, we first of all execute the program before we check the condition.
Then go ahead and say that this is 11 and that 11 is less than ten.
If I run this code, you see, I don't have anything like 11 right in here.
Now do while loop is go ahead and take this white condition out of this white condition and I'm going
to place it right in here.
So that is the while loop and then put a semicolon at the end and this place removed the while loop.
I'll go ahead and put do and then I'll go ahead and save.
So if I run this program 11, we first of all we printed out the body will be printed out before we
go ahead to check the condition.
Now let's go ahead and run this code and check it out.
11 so it has executed is 11 and nothing again happened.
The reason is because in the while loop we first of all is the body before checking for the condition.
Now if I go back here and put this to be equal to one and save this and run this code and have 1 to
10, one was actually printed out.
Then it goes and check the condition and came back to print out the other ones.
So this is the difference between while loop and do while loop.
So I hope that is clear and is very straightforward.
So go ahead and put it on your own.
Check it out, play around with it.
And if you have any questions on this, please go ahead and use the question and answer section.
And I'm going to get back to you as soon as possible.
Thank you so much.
And I'm going to see you in the next video lecture.