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

preview_player
Показать описание
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:

🤑🤑 Donate


🎓🎓 Find me on Udemy

Рекомендации по теме
Комментарии
Автор

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.

TheLinguists
Автор

Break is super helpful, I use both of these in most of my projects. 🔥

HostDotPromo
Автор

For anyone that is still confused aftsr watching it multiple times, I will try to help:

1. If the break statement is *true*
2. If the continue statement is *true*
Then, it will *echo.*

1. If the break statement is *true.*
2. If the continue statement is *false.*
Then, it will *not* echo

Hope that helps :)

Thank you Mr Ninja. I enjoyed your videos and learnt a lot from it. Your style is teaching is very to understand too ❤

haziqhilmi
Автор

Ninjas learning PHP, tech ninjas, anyway, good course Net Ninja ! Learnt a lot in all your courses

lukabarry
Автор

I ironically got a bit stuck with the "continue"! Well, I have managed to understand by myself after playing back and forth with the code. For my kind of logic, it was a bit difficult to assimilate that "continue" might in fact mean "don't execute the code below if the condition is met, but stay in the loop". Maybe that might have been more clear to me not to addition both break and continue, but switch them at first, one by one, and then show afterwards what they do when they are combined.

jeansienkin
Автор

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.

seppgl
Автор

Thanks for your efforts ❤️❤️❤️❤️❤️❤️❤️❤️❤️

Автор

dear shaun why don't you take us to a tour inside your studio? we wanna see you and your workstation

md.akib
Автор

Amazing s̶p̶i̶d̶e̶r̶m̶a̶n̶ Ninja shaun

md.akib
Автор

Mr: shawn, can you prepare some tutorials on advanced php and SQL after this basic tutorials.

username
Автор

you are my ninja champion you are my ninja king you are my ninja hero you are my ninja GOD

Автор

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

danielrossi
Автор

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

seppgl
Автор

so "continue" means "skip the return"

Tuttigiu