PHP Loops Tutorial - Break & Continue Statements - Full PHP 8 Tutorial

preview_player
Показать описание
Loops are simple but there are some important things that you need to be aware of when working with them, such as performance, things to be aware of when working with references, how to break out of nested loops, how to handle infinite loops & so on. Loop is basically a control structure that allows you to execute a block of code or multiple statements N times until a given condition evaluates to false or you manually break out of the loop. In this video, we cover while loops, do-while loops, for loops & foreach loops with examples on iterating over strings, arrays, and so on.

SOME OF THE WAYS YOU CAN SUPPORT THE CHANNEL
👍 Smash the like button
🤝 Subscribe to the channel & turn the notifications on
💬 Post comments, any feedback is greatly appreciated
THANK YOU!

LESSON 1.16

CHAPTERS
00:00 - Intro
00:15 - While loop
01:05 - Infinite loops
01:32 - Break statement & use-case of an infinite loop
02:05 - Break out of multiple levels of nested loops
02:31 - Continue statement
03:32 - Alternative while loop syntax
03:47 - Do-While loop
04:26 - For loop
05:07 - Multiple expressions within for loop
05:48 - Iterate over strings
06:09 - Iterate over arrays
06:23 - Performance concerns
07:20 - Foreach loop
08:38 - Overwriting array elements using assignment by reference
09:15 - Something to be aware of - variable within the foreach loop is not destroyed
10:30 - Iterate over associative arrays
11:48 - Alternative foreach & for loop syntax
Рекомендации по теме
Комментарии
Автор

Finally I think I've found my PHP guru on youtube :)

jipeejoce
Автор

This has to be the best PHP series i have ever watched. Senior PHP Developer and i'm impressed with the amount of learning i'm still doing while watching here. Great videos man. Keep it up.

letlhogonolosylverstermaak
Автор

Man! You put every crash-course to shame. You don't even try to deliver one, yet It's more concise and packed with information, than the longest "crash-courses" on YT. It's such a joy, and so well explained, it's really unique. You have a gift, sir! Keep using it!

neozes
Автор

WoW !!! that's how a programming language should be taught.

helpdesk-hpu
Автор

I just discovered that the variable of the last iteration is still accessible after the foreach loop! 🤯 Thanks for the great explanations. I can't wait for the series to be complete!

henrik
Автор

This tutorial in an absolute gem. You helped me so much during my studies that I just couldn't thank you enough! You are a lifesaver!

maria_sss
Автор

wow did not know.. loop variable lasted and can be used as reference.. so much learning. Thank you man

prajwalsiwakoti
Автор

Man, that's totally stunning, I can say with clear conscience, it's the best "detailed" php-full Guide online.
Currently I'm watching the whole serie. Please don't stop, even if the num of watchers aren't what u deserve, but soon it's gonna be different.
Just thx man 🎩 off.

mahmoudmoussa
Автор

Wow, I never knew you can break or continue nested loops so easily. Awesome stuff.

veltive
Автор

been using break for a long time without fully understanding its use. glad I didn't skip the basics for this playlist

janedawg
Автор

Another brilliant video! You clearly understand the kinds of mistakes that noobies make, so thank you for taking the time to emphasize how to NOT create an infinite loop!
The way you explain the foreach loop is so clear, and showing a few options on how to use them really cements the concept.
You really are very gifted at teaching. Most people seem to forget what it's like to not know anything about a language, or programming. So they omit information because they assume something is quite obvious. You don't make those assumptions, thankfully. :)

lotuslando
Автор

Thank You Soo Much ! You just saved me from endless headache.

askiomen
Автор

The info about 'the last iteration is still accessible after foreach' is very very useful for me. Thank you again sir

jessieren
Автор

Impressive!
Very detailed, Informative & Straight-forward!
Keep up the good work!
Thanks!

ahmedmahdy
Автор

Your PHP tutorials are a rare gem on YouTube! I'm genuinely impressed by how you manage to pack each lesson with so much valuable information while keeping them concise and easy to understand. The way you delve into even the tiny details without overwhelming your viewers is remarkable. Your approach makes learning PHP both enjoyable and incredibly efficient. Thanks for sharing your knowledge and expertise with us! Out of curiosity, do you plan to create similar tutorials for other programming languages or frameworks in the future?

isroilbekjamolov
Автор

Really Great explain of PHP Loops, Thank you

MYDev
Автор

I like foreach loop in PHP. Thanks a lot for the video!

Vitalii-mr
Автор

You are really awesome bro.
explain every episode with details

swamsaung
Автор

Amazing Excellent techniques for displaying array into arrays. Thanks !

petruciucur
Автор

thanks a lot, because of your tutorial I made an algorithm that returns the result of some number from the multiplication table, and I did it myself :)

gincaza