Follow:  Follow PHPExercises on Twitter  Follow us on Facebook


These exercises ask you to create simple arrays and associative arrays. You will also be using these arrays in forms and in processing user input.

The Arrays section includes the following exercises:

#1: Simple Arrray
Create an array of weather phenomena, then use it in a sentence.
#2: Simple Array Loop
Create, manipulate, and add to an array of large cities.
#3: Arrays from User Input
Using the weather conditions from #1, ask the user which apply, then return them in a bulleted list.
#4: Add User Input to Array
Create an array of modes of transportation, then let the user expand the list indefinitely.
#5: Associative Array
Back to the ten large cities, this time with the applicable country for each used as key. Select field created using the array.
#6: Manipulate the Array
Create an array of 30 spring time high temperatures, then gather data from it.
#7: Multi-Dimensional Array
Starting with the big cities array from #5, write a two dimensional array, then convert the sub-arrays into associative arrays. Use both to create a table.

-- Home --