Beginner PHP Tutorial – 26 – do while Loop

[ad_1]
Facebook –
GitHub –
Google+ –
LinkedIn –
reddit –
Support –
thenewboston –
Twitter –


Posted

in

by

Tags:

Comments

25 responses to “Beginner PHP Tutorial – 26 – do while Loop”

  1. Kimani Wa Ndirangu Avatar

    An example where do..while loop is used is in controlling the running of a program for instance in a Bank ATM. The Main Menu in the ATM will always show as long as the customer doesn't select 'NO'..The ATM always asks the customer : After every transaction, the ATM always asks a customer : "Do you want to perform another transaction?"…As long as the answer is YES, the ATM will display the Main Menu. Hope this real-world application is clear.

  2. Jason Jepson Avatar

    He should have set counter to 11 (or anything above 10) to demonstrate that the echo will still show at least ONCE, even if the condition in the while loop is false. Don't know why he didn't. Sometimes I ponder his programming knowledge it makes me hesitant to continue with this series D= (I originally started with this playlist because I wanted good ole Bucky)

  3. Hamza Khan Avatar

    Awesome explanation (y) πŸ˜€ πŸ™‚

  4. Varun Singh Avatar

    Hey Alex, I wanted to tell you that you have been very helpful. But in this video you forgot to tell us that we need to terminate the line after while () loop condition.Β 

    do {
    } while ();

    like this. Thank you by the way

  5. puru Avatar

    I feel that PHP is a breeze after learning C. The syntax is so similar in different places.

  6. Rasul Palmer Avatar

    Thanks for the simple explination man, helps me out

  7. Holmisatube Avatar

    Thats what it does anyway. Nomatter if I had a justin bieber picture.

  8. Parth Parpyani Avatar

    Why should I trust you, your profile picture is a troll face.

  9. Holmisatube Avatar

    Another way to describe it is to its the opposite to "Do Until" (even tho it doesn't exist)
    Instead of go out of the loop when the condition returns true, it stops the loop when the condition return false

  10. Raja najungal Avatar

    thanks bro
    very nice

  11. PunkITechs Avatar

    Do while loops should normally be used for debugging, as they are the source of a lot of bugs in programming.

  12. Fakir Yahya Avatar

    We dont make a " ; " after while() ??

  13. LtJohnny117 Avatar

    lol i bet the police are stalking his house and like as soon as he its record they are like "Big Red move out!" WEEEWOOO

  14. HDDesign1337 Avatar

    The views are dropping more and more with every video! So many people give up πŸ˜›

  15. Seth Earby Avatar

    Kind of late but, not exactly for displaying text. However, you could make a Boolean for continuing a web page. And lets say the user does not input his name some where on the page. And the text box's name is "User". And User contains nothing, then stay on the page. If User contains a value then go to the next page. Most of these tutorials are made using very basic concepts.

  16. AwesomeVideos300 Avatar

    I haven't been hearing sirens for a while…

  17. Biosystem Studios Avatar

    @540veera a while loop will not run at all if the condition is false.

    A DO while loop will no matter what run the loop at least once

  18. veera mann Avatar

    what is diffrence between do while Loop and while loop…?

  19. airkami Avatar

    @iinsanebaby text-based output example:
    Choose a topping
    1 bacon
    2 cheese
    3 nothing
    (user presses 1 or 2)

    do you want another topping? (in the code this will be right before the line with the "while()" part)
    1 yes
    2 no

    if they pic 1 again, it sets the value in "while(value)" to true so that they can add more bacon or cheese

    if they pic 2 here or 3 on the first question, it sets the value in "while(value)" to false and the loop is exited when the user is done with it.

    I hope that helps

  20. HAGAKUREBUSIDO Avatar

    thank you Alex. this tutorials can easily change some huge books.
    respect

  21. iinsanebaby Avatar

    Can anyone give some examples of where u can apply this???

Leave a Reply

Your email address will not be published. Required fields are marked *