This chapter gives you a quick overview of PHP syntax and language constructs. If you are already a PHP programmer, it might fill some gaps in your knowledge. If you have a background using C, Perl, Python, or another programming language, it will help you get up to speed quickly. In this book, you'll learn how to use PHP by working through lots of real-world examples taken from our experiences building real websites. Often, programming textbooks teach basic syntax with very simple examples. We have chosen not to do that. We recognize that what you do is get something up and running, and understand how the language is used, instead of plowing through yet another syntax and function reference that's no better than the online manual. Try the examples. Type them in or download them from the website, change them, break them, and learn how to fix them again. This chapter begins with the example of an online product order form to show how variables, operators, and expressions are used in PHP. It also covers variable types and operator precedence. You will learn how to access form variables and manipulate them by working out the total and tax on a customer order. You will then develop the online order form example by using a PHP script to validate the input data. You'll examine the concept of Boolean values and look at examples using if, else, the ? : operator, and the switch statement. Finally, you'll explore looping by writing some PHP to generate repetitive HTML tables. Key topics you learn in this chapter include.