Home  >  Article  >  Backend Development  >  if() endif alternative syntax

if() endif alternative syntax

WBOY
WBOYOriginal
2016-07-25 08:45:561395browse
  1. if (expression):
  2. ?>
  3. statement
  4. endif
  5. ?>
Copy code

The above writing method is an alternative syntax for PHP process control.
There are several alternative syntaxes in PHP flow control:
if,while,forforeach,switch
The basic form of the alternative syntax is:
Replace the opening brace ({) on the left side of the flow control statement with a colon (:), and the closing brace (}) on the right side can be replaced with endif or endwhile or endfor or endforeach or even endswitch.

endif


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:VirtualHost configurationNext article:VirtualHost configuration