20: How to Create a Foreach Loop in PHP | PHP Tutorial | Learn PHP Programming | PHP for Beginners

preview_player
Показать описание
How to Create a Foreach Loop in PHP | PHP Tutorial | Learn PHP Programming | PHP for Beginners. In this PHP tutorial you will learn about foreach loops which are often used in PHP scripts. Loops are used to loop through multiple pieces of data from arrays one at a time. Loops can help with spitting out a lot of data using little code.

➤ GET ACCESS TO MY LESSON MATERIAL HERE!

First of all, thank you for all the support you have given me!

I am really glad to have such an awesome community on my channel. It motivates me to continue creating and uploading content! So thank you!

I am now using Patreon to share improved and updated lesson material, and for a small fee you can access all the material. I have worked hard, and done my best to help you understand what I teach.

I hope you will find it helpful :)

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

There are teachers out there that have no place being teachers, and then there’s guys like you Daniel who are like the GSP of UFC at teaching. Truly great watching your videos. once I have done your complete course from your website, I will donate. ps: I came from php manual and their explanation of foreach was just so confusing.

jamesbarratt
Автор

had spent time banging my head watching tutorials here. My search ended with your professional, considerate as well as warm videos. Thanks so much for these. Please keep up the good work.

gagandhillon
Автор

I am 16 years old, and i love coding
To thank this guy, i don't skip his ads and let it play until its gone

eldricost
Автор

Thank you for your tutorial. As a new learner of PHP and English, I find it's very useful, so I guess that means native speaker can easily understand.

wudi
Автор

Thanks really helped me understand better than my lecturer. Easy understandable and enlightened. would recommend.

waldoglas
Автор

Dude you are amazing exaplained everything better than my teachers

SamyHadera
Автор

Thank you mmtuts! I agree with others that your tutorials are among the best that I've found on YouTube! Great job! :D

birdman
Автор

A good explanation. in while loop, we echo values separately. we can add div's in both sides of output results so we can style. how to style foreach output values using Css?.

axayPzea-qmsv
Автор

You are truly a best Teacher. Very easy and effective tutorials. Thank You! stay blessed

nancyfazal
Автор

Thank you man for these excellent tutorials! PHP is so similar with JS and it's so easy when you know JS already. You are so great at explaining things!

skimerroyaltyfreefootages
Автор

Actually you can also do something like this foreach($array as $key=>$value) to acces both value and key. And i would suggest to add the way keys are assigned to new values added the the array.

auras
Автор

Super explanation you did such a great job bro cheer up keep up

yousifnyala
Автор

After 10 times watch this video finally i understand TQ donuld trump

movine
Автор

You actual this concept very easy to understand. Thanks man, you def have a sub from me.

taishienglish
Автор

Thank you sir for your nice explanation.

princeiscpv
Автор

Bro what keyboard do you use? I don't know why but I find the clicking sound soo satisfiying lol

unkownsiner
Автор

Hi, Thank you for the tutorial.. but I have a question !

The variable "$loopdata" there is no value of it, but its working, how?

could you please explain?

MdMorshedAlamBadhan
Автор

Just criticism of videos....most programmers understand the concepts of arrays and for each etc. It's the syntax of the unknown language that trips up most programmers. Like PHP using the dot for concatenation.

cagedtigersteve
Автор

Why do we need to create a new variable in the foreach loop, for example in this video a variable called '$loopdata", why not use the '$array' itself? thanks =)

fakhrinorhisham
Автор

Sir, but why can't we directly use the variable name ($array) instead of referring it to another variable $(loopdata)?
I did try this example, but I'm not getting why we need to assing the old variable to a new variable?

yeshudavid