The alternative syntax in PHP & nbsp; today I checked the wordpress code. some of the less common php Alternative syntaxes are: & lt ;? Phpelse :? & Gt; & lt; divclass & quot; entry-content & quot; & gt; & lt ;? Phpthe_content (_ (& #39; substitute syntax in Continuereading PHP
Today I read the wordpress code, which contains some rare Alternative php syntax,
'
' . __( 'Pages:', 'thebox' ), 'after' => '
' ) ); ?>
What do the colons and endif after else represent? I have never met a Cainiao, so I just googled it to understand that this is an alternative syntax for php,
Colon (:) is equivalent to Left curly braces ({), and endif is equivalent to right curly braces (});
For example:
Is a negative number.
The preceding statement is equivalent
Is a negative number.
Which of the following statements in PHP have alternative syntaxes?
Process control (including if, while, forforeach, switch) statements have alternative syntax.
The basic form of alternative syntax:
Replace Left curly braces ({) with colons (:), and change right curly braces (}) with endif;, endwhile;, endfor;, endforeach; and endswitch;
While alternative syntax:
Loop point
Other alternative syntaxes can be similar.