When developing applications, the use of control structures such as conditional statements, loops, and objects are expected to be used appropriately (as defined by the needs of the application). The use of unconditional branching (i.e. goto statements) is not supported.
When nesting control structures, you must adhere to the following limitations:
When using conditional statements, loops, and defining class functions and variables, you should always use braces. While some languages will allow you to use a conditional statement without using braces, it is helpful to use braces to prevent inadvertent errors during future development. There are a number of common styles for using braces. The University of Arizona Library supports the two following styles:
<?php if($thisYear % 4 == 0) { // Print out our leap year message echo "The year " . $thisYear . " happens to be a leap year. What ". "an exciting event!\n"; } else { // Print out our normal year message echo $thisYear . " is not a leap year.\n"; } ?>
<?php if($thisYear % 4 == 0) { // Print out our leap year message echo "The year " . $thisYear . " happens to be a leap year. What ". "an exciting event!\n"; } else { // Print out our normal year message echo $thisYear . " is not a leap year.\n"; } ?>