Today looked at the WordPress code, there are some rare php substitution syntax,
else :?> class= "Entry-content" > <?php the_content (' Continue reading <span class= "Meta-nav" >→</span> ', ' Thebox ');?> array(' before ' = ' <div class= ' page-links ">". __ (' Pages: ', ' Thebox '), ' after ' + ' </div> ');?> </div><!--. Entry-content- E NDIF;?>
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.
Search Number:ruixin, or scan the QR code below, follow the blog public number, irregular brain the Internet: