Ajax-loader-large-white
For Loops in PHP
Loops + Arrays = ForEach

The foreach loop is used to iterate over each element of an object—which makes it perfect for use with arrays!

You can think of foreach as jumping from element to element in the array and running the code between {}s for each of those elements.

Instructions

Check out the code in the editor. See how the $lang variable takes on the value of each of the elements in $langs, one by one, then echos that element to the page?

Click Save & Submit Code to learn how it all works!

index.php
stylesheet.css
project
View Preview