PHP short marker <?? > < with long markers;? The difference between php?>

Source: Internet
Author: User
The so-called identifier refers to the name of the variable.

The names of functions and classes are also identifiers.

PHP Rules for identifiers:

  • Identifiers can be any length of letters, numbers, underscores, and do not begin with a number.

  • Identifiers in PHP are case-sensitive, but the function name is an exception.

  • The variable name can be the same as the function name. But should be avoided as far as possible.

  • You cannot create a function with the same name as an existing function.

Short marks are used only to output variables or expressions, and the general usage is

<?= $a? ><?= (expression)?>

is equivalent to

<?php echo $a? ><?php echo (expression)?>

such as if, for and other structures.
If you write

<?if (...?). >

He's going to turn you into

<!--if (...-->


So write the program must use a long mark, the HTML inserted in the output will be marked with a short.

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.