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:
“Our mother gives us our earliest lessons in loveand its partner, hate. Our fatherour second otherMelaborates on them. Offering us an alternative to the mother-baby relationship . . . presenting a masculine model which can supplement and contrast with the feminine. And providing us with further and perhaps quite different meanings of lovable and loving and being loved.”
—Judith Viorst (20th century)
“The awareness that health is dependent upon habits that we control makes us the first generation in history that to a large extent determines its own destiny.”
—Jimmy Carter (James Earl Carter, Jr.)
“If there are people who feel that God wants them to change the structures of society, that is something between them and their God. We must serve him in whatever way we are called. I am called to help the individual; to love each poor person. Not to deal with institutions. I am in no position to judge.”
—Mother Teresa (b. 1910)