Alternative syntax in PHP
Today looked at the WordPress code, there are some rare php substitution syntax,
→ ', ' thebox '));?>
'. __ (' Pages: ', ' Thebox '), ' after ' + ') ');?>
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:
is negative pull
The above statement is equivalent to
is negative pull
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:
Loop dot What
Other alternative syntaxes can be analogous.
http://www.bkjia.com/PHPjc/847859.html www.bkjia.com true http://www.bkjia.com/PHPjc/847859.html techarticle PHP Alternative syntax to see a bit of WordPress code today, there are some rare php substitution syntax, →, thebox); ?>. __ (Pages:, Thebox), after =);?> else the colon after ...