Basic syntax-PHP manual notes

Source: Internet
Author: User
: This article mainly introduces the basic syntax-PHP manual notes. For more information about PHP tutorials, see. PHP tag

If the file content is pure PHP code, it is best to delete the PHP end mark at the end of the file. This avoids accidental addition of spaces or line breaks after the PHP end mark, which may cause PHP to start to output these spaces, but the script does not have the intention to output at this time. Of course PHP start marking The leading space or line break will still be output.

Use conditional Advanced Separation

The following code is easy to understand. The key is the use of if-else, which makes the explicit logic clearer in text output.

  This will show if the expression is true. Otherwise this will show. 

Command separator

PHP needs to end the instruction with a semicolon after each statement. this semicolon is called the instruction separator. You can end the last line in a PHP code snippet without a semicolon.

Note

PHP supports comments in C, C ++, and Unix Shell (Perl style), that is/**/,//,#.

A single-line comment is only commented to the end of the line or the current PHP code block, which means that// ... ?>Or# ... ?>The subsequent HTML code will be displayed. However,《script》Marking in a single line comment does not jump out of the PHP mode.

(Full text)

The above introduces the basic syntax-PHP manual notes, including the content, and hope to be helpful to friends who are interested in PHP tutorials.

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.