Section II

Working with PHP Controls, Functions, and Forms

  • Lesson 7: Making Decisions
  • Lesson 8: Repeating Program Steps
  • Lesson 9: Learning about Scope
  • Lesson 10: Reusing Code with Functions
  • Lesson 11: Creating Forms

In this section you learn how to make a program perform different actions based on different criteria. If variables are nouns, control structures are verbs.

In Lesson 7, you learn how to set up conditional statements so that code is performed only if the conditions are met. In Lesson 8, you learn how to make the program loop, performing the same action multiple times.

You discover how local and global scope work in Lesson 9. Scope refers to where a specific variable, function, or object can be seen. You create user-defined functions in Lesson 10, and in Lesson 11 you use what you have learned so far as you process forms.

Get PHP and MySQL® 24-Hour Trainer now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.