PHP Foreach Loop Tutorial

preview_player
Показать описание
Upgrade your Clever Techie learning experience:

UPDATE! (9/13/19) New features and improvements for Clever Techie Patreons:

1. Download full source code with detailed comments - easy to learn and understand code
2. Weekly source code file updates by Clever Techie - every time I learn new things about a topic I will add it to the source file and let you know about the update - keep up with the latest coding technologies
3. Library of custom Clever Techie functions with descriptive, easy to understand comments - skyrocket coding productivity, code more efficiently by using Clever library of custom re-usable functions
4. Syntax code summary - memorize and review previously learned code faster
4. Organized file structure - access all Clever Techie lessons, source code, graphics, diagrams and cheat sheet from a single workspace - no more searching around for previously covered material and source code - save enormous amount of time and effort
5. Outline of topics the source file covers - fast review of all previously learned coding lessons
6. Access to all full HD 1080p videos with no ads
7. Console input examples - interactive examples that make it easier to understand and learn coding
8. Access to updated PHP Programming Book by Clever Techie
9. Early access to Clever Techie videos

Subscribe to Clever Techie patreon:
We learn how the syntax of PHP foreach loop works which is used to loop through associative arrays in PHP. We also explore an alternative syntax of writing the foreach loop as well as modifying the values inside the loop directly using values by reference.

`````````````````````````````````````````````````````````````````````````````````````````````
Hey guys, I'm now using Patreon to share improved and updated video lesson material. For a small fee you can access all the downloadable files from this lesson (source code, icons & graphics, cheat sheets) and everything else included in the video from the Patreon page. Additionally, you will get access to ALL Clever Techie videos in HD format with no ads. Thank you so much for supporting Clever Techie :)

Download this video's files here:

( You also get access to ALL source code and any downloadable content of ALL Clever Techie videos, as well as access to ALL videos in HD 1080p quality format with all video ads removed! )

`````````````````````````````````````````````````````````````````````````````````````````````

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

Thank You Clever Techie, after years of coding, this is the very first time I see someone explain associative arrays and loops in such an easy to understand examples.

SamuelRamirezTijuana
Автор

2 hours google searches and you've explained it in 3 minutes. Thank you big time.

JonyTelev
Автор

I have been watching your tutorials and I got to say you are "KILLING IT!". From all the videos I enjoyed yours. All other youtubers that provide tutorials doesn't have anything on you. I go to some of the videos and I am left disappointed. You have put a lot of work into them. It reminds me of me when I was with Instinet, IBM, Microsft, etc when I would create handbooks with a lot of details and images. Keep up the go work. Sometimes I don't have time to go through a PHP book and your videos on the subject speeds my learning process. You videos and a good book helps my learning. I especially love the 100 PHP functions series. I let your videos run all day, like someone does for music. This way it can go into the sub-conscience mind.

rembrandt
Автор

Modifying arrays by reference was what I was looking for. It is a short and clear explanation. Thanks a lot.

bozok
Автор

Than u very much It's been tow hours I couldn't figure it out. now I get this...

dopamine_Seeker
Автор

You explained it better in 6 minutes than my prof did in 30. Subscribed!

jolandal
Автор

its so professional ... thanks ... by the way which editor is it ??

ahmadalkordee
Автор

The video was very Clever, Techie


lol thank you for the tutorial!

birdbrainsolutions
Автор

Why'd you have to end the foreach loop, doesn't it run till the end of the array regardless?

Backflipmarine
Автор

How can you use 'foreach' to get all the items to appear in a different color?

chome
Автор

great explanations! thnx so so much ! great sum up :) !

niyagentleman
Автор

Hello! Great Tutorial! My question is : I have an multidimensional array and I want to search for a specific key value. When I find the results, I must replace the key value to another key. How can I achive that? Thank you for your time

CostasMoschopoulos
Автор

Hi,
I enjoyed your tutorial. While trying it out, to use it to populate a <select><options> form element, so that selecting one of the options in a form, I can insert that selection into a database table. I was shocked to see that only one option, the last item in the array, was getting inserted into the table, regardless of which option is selected!
Any idea why? Is it wrong to use the foreach loop in this manner?

NedumEze
Автор

DaBest !!! explaination ever !!!! <3 thank youu soo much keep teaching ! more power ! <3 Godbless

localLyricsPh
Автор

I watched this and did the exact same thing but for some reason it only multiplies my last number. The coding is correct so what am i doing wrong?

Amar-yzvy
Автор

seriously ur better than my teacher lol

niyagentleman
Автор

Hi thanks for this useful tutorial. May i ask, from your example above, how can we store the $name from the $animal array into a variable and we want to store it in string? Thanks for your reply in advance sir

afaztrw
Автор

Parse error: syntax error, unexpected 'endforeach'

AndrewMarsin
Автор

Thanks for the explanation but after you unset($numbers); it will give an error if you want to print it after this function, , because $numbers is unset now

alaamansour
Автор

Its strange use to array(), 4years ago

mirosh