TAG = loops

How to Return Multiple Values from Functions in PHP

Author: Patrick Morrow

In this lesson we will look at how to return multiple values from functions in PHP. We will look at how we can return an array and then how we can loop through the array to retrieve the content.

Read More loops php

Using Loops in PHP

Author: Patrick Morrow

In this short lesson we look at how to construct some simple loops and why they are used.

Read More php loops

PHP Challenge 3 - Create a Multiplication Grid

Author: Patrick Morrow

As a developer you will be using loops regularly. This challenge requires you to use nested loops to produce a multiplication grid and then use some basic styling to identify square numbers.

Read More php html loops css challenge

How to Create an RSS Feed Reader

Author: Patrick Morrow

In this lesson we will take an external RSS feed, read it using the PHP simplexml_load_file function and then loop through the file presenting the feed on our website.

Read More php html loops

How to produce a chessboard pattern in PHP

Author: Patrick Morrow

This is a great lesson for those who want to learn more about nested loops and conditional statements. We produce a simple chessboard pattern.

In this lesson we will create a chessboard pattern, an 8x8 grid of black and white squares like this:

Read More loops php html

How to use foreach loops

Author: Patrick Morrow

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.

Read More php loops

PHP for Beginners

Would you like lifetime access to the hugely successful PHP for Beginners course? Click here to find out how.

FREE Code Snippets

FREE hints and tips delivered direct to you once per month.