Substitute syntax in PHP

Source: Internet
Author: User
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.

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.