Control Structures
Introduction
Any PHP script is built out of a series of statements. A statement
can be an assignment, a function call, a loop, a conditional
statement or even a statement that does nothing (an empty
statement). Statements usually end with a semicolon. In addition,
statements can be grouped into a statement-group by encapsulating a
group of statements with curly braces. A statement-group is a
statement by itself as well. The various statement types are
described in this chapter.
&reftitle.seealso;
The following are also considered language constructs even though they are
referenced under functions in the manual.
list
array
echo
eval
print
&language.control-structures.if;
&language.control-structures.else;
&language.control-structures.elseif;
&language.control-structures.alternative-syntax;
&language.control-structures.while;
&language.control-structures.do-while;
&language.control-structures.for;
&language.control-structures.foreach;
&language.control-structures.break;
&language.control-structures.continue;
&language.control-structures.switch;
&language.control-structures.match;
&language.control-structures.declare;
&language.control-structures.return;
&language.control-structures.require;
&language.control-structures.include;
&language.control-structures.require-once;
&language.control-structures.include-once;
&language.control-structures.goto;