Today looked at the WordPress code, there are some rare php substitution syntax,
<?php Else: ><div class= "Entry-content" ><?php the_content (' Continue reading <span class= ' Meta-nav ">→</span>", ' Thebox ')); ><?php wp_link_pages (Array (' before ' = ' <div class= ' Page-links ">". __ (' Pages: ', ' Thebox '), ' after ' </div> '),?></div><!--. entry-content--><?php endif; ?>
What does the colon and endif after else mean? Rookie one, have not seen, so on Google a bit, just understand that this is the substitution of PHP syntax,
The colon (:) equivalent to the left curly brace ({), endif equivalent less right operand curly braces (});
Let's take an example:
<?php if ($a <0):?>
is negative pull
<?php endif;?>
The above statement is equivalent to
<?php if ($a <0) {?>
is negative pull
<?php}?>
Is there an alternative syntax for those grammars in PHP?
Process Control (including If,while,forforeach,switch) has alternative syntax for several statements.
The basic form of alternative syntax:
The left curly brace ({) is replaced by a colon (:) and the right curly brace (}) is replaced by a endif;,endwhile;,endfor;,endforeach; and Endswitch;
While substitution syntax:
<?php while (expr):?>
<li> Cycle Point What </li>
<?php Endwhile;?>
Other alternative syntaxes can be analogous.