In this lesson we look at how to create a foreach loop in PHP. There are many uses for loops, especially when you deal with returned data from a database query. In this example we shall consider an array of values and we will loop through those values and output each.