Statements and Structures
Practice writing statements, so you can become comfortable initializing variables and performing basic operations on the values stored in variables. Write basic structures, to practice working with sequences, decisions, and loops. Finally, write a simple program that incorporates all three structures.
You may start by studying the heavily commented, example program provided. First, view its rendered output, which is just an HTML document. Next, read through the color-coded, PHP source code to see how the program built the HTML document. Each step includes liberal comments to help you understand the step's operation and expected result.
After reading the commented program source, review the uncommented version with the source code collapsed to a few dozen lines. If you survived the commented version, you may find that you can understand basic PHP code without much difficulty. You may start with this version for the second assignment.
Exercise #2
A. Following the example of the table builder program, write your own HTML list builder. Use a value to determine if the program should output an ordered list or unordered list.
B. Modify the example table builder program to enter different values in the table cells. The values may be numeric, if you find that easier to accomplish.
Hint: Try using one of the counters as a source for a changing value!