PHP Tutorial (& MySQL) #12 – Continue & Break

13
1



Continue and break are two important keywords in PHP, so in this tutorial I’ll show you how we can use them to break out of the normal loop cycle.

—————————————-

🐱‍💻 🐱‍💻 Course Links:

+ Course files –

+ VS Code editor –

+ Materialize Playlist –

🤑🤑 Donate

+

🎓🎓 Find me on Udemy

+

Nguồn: https://milchreis.org/

Xem thêm bài viết khác: https://milchreis.org/cong-nghe/

13 COMMENTS

  1. Hello #TheNetNinja, first I really want to thank you for these fantastic videos..they represent great teaching value! and second, I have a doubt.
    While I follow your course I always try not to copy word by word so I create my own projects based on your teaching. What happened is that in this Break and Continue class I realised that I don't understand the real meaning of ===.
    I say this because in the class Booleans & Comparison you said that:
    echo 'frank' == 'frank'; but
    echo 'frank' > 'Frank'; and this is True because a string with capitol letter is smaller than lower case letter
    Also, and probably more important in this case:
    echo 'Frank' > 'Alfred'; and this is True because in the alphabet F come after than A
    This said, than why, in your example: " if($product['name'] === 'lightning bolt') { " the " name === lightning bolt " ???
    shouldn't it be like 'name' === 'name' in order to be True or any other word starting with 'n' ?
    Thank you very much

  2. As a teacher (Linguistics), I so love your presentation style that I 'm going to buy your Javascript course once I m done with the PHP here. I have bought two Javascript courses (by others) on Udemy but after the first chapter I was disappointed with them. Yours is awsome! many thanks.

  3. pls. forget about my request for the sql-database in my post below. I should have followed your Youtube-#25 first. Sorry.

  4. Thanks a lot to Shaun for this wonderful tutorial. Coming from C, I am a newbe to PHP and I am looking forward to the tutorials 13…42. In the meantime I looked through the material up to #26, where I am missing the sql-database "ninja_pizza". Could you please add it to git-hub? Thx.
    A comment to #12 tutorial:
    In the world of modern procedural programming, there is a strong convention to ban directives like "goto", "continue", and "break". They are considered bad programming style, as they lead to code, that is hard to read and to maintain.

    This goes back to the 1980s, where structured-programming came up.

    Looking into #12 tutorial, I would recommend to never use "continue" or "break".
    Please don't take this as critizism, but I would like to maybe start a discussion about, how this is considered today.

LEAVE A REPLY

Please enter your comment!
Please enter your name here