Posted on

In this video I show you how to use the break statement to break out of a loop early, and I also show you how to use the continue statement to skip 1 loop iteration.

Follow me on social media:
Snapchat: quentinwatt92

Become a Patron:

Subscribe to my Vlog channel:

Subscribe to this channel:

My website:


Xem thêm bài viết khác:

4 Replies to “PHP beginners tutorial 21 – break and continue”

  1. Good video, but all these examples are way too simple, and it becomes very confusing while doing complicated code. Im not the best at this. I have a file and an array with usernames and passwords stored in an array, I simply need to validate user input against this array, the foreach loop is great, but it does not work because it keeps looping through all the elements instead of breaking after the right value is found, and it is not just username, its password as well, how could I get this?

  2. I did like this for continue statement:

    /* count 2 to 24 but only even numbers */

    for($a=2; $a<=24; $a++){
    echo 'My name is ',$a,'.<br/>';

Leave a Reply

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