php

Page 124

Chapter 4:

Figure 4-2

Working with Arrays

A Web form to select pizza toppings

When the Web form is submitted, PHP automatically places all the checked values into the $_POST['toppings'] array. This array can then be processed like any other array—in this case, with a foreach loop that prints the selected toppings in an ordered list. Figure 4-3 illustrates this output.

Figure 4-3

The result of submitting the form

99


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.