Alternative Syntax For Control Structures
PHP offers an alternative syntax using colons rather than the standard curly-brace syntax (of "{...}"). This syntax affects the following control structures: if, while, for, foreach, and switch. The syntax varies only slightly from the curly-brace syntax. In each case the opening brace ({) is replaced with a colon (:) and the close brace is replaced with endif;, endwhile;, endfor;, endforeach;, or endswitch;, respectively. Mixing syntax styles within the same control block is not supported. An example of the syntax for an if/elseif statement is as follows:
if (condition) : // code here elseif (condition) : // code here else : // code here endif;Read more about this topic: PHP Syntax And Semantics
Famous quotes containing the words alternative, control and/or structures:
“Education must, then, be not only a transmission of culture but also a provider of alternative views of the world and a strengthener of the will to explore them.”
—Jerome S. Bruner (20th century)
“Every expansion of government in business means that government in order to protect itself from the political consequences of its errors and wrongs is driven irresistibly without peace to greater and greater control of the nations press and platform. Free speech does not live many hours after free industry and free commerce die.”
—Herbert Hoover (18741964)
“The American who has been confined, in his own country, to the sight of buildings designed after foreign models, is surprised on entering York Minster or St. Peters at Rome, by the feeling that these structures are imitations also,faint copies of an invisible archetype.”
—Ralph Waldo Emerson (18031882)