PHP--php Basic Grammar of learning notes

Source: Internet
Author: User
PHP Basic Syntax

Directory

1.1PHP Language Tags

1.2 Instruction delimiter "semicolon"

1.3 Notes in the program


Content

1.1 of four PHP language tags (same page unified style)

   Recommended use of this

  

  

<%%>

  

1.2 instruction delimiter ";"

There are two types of statements:

One is the function execution statement (Assignment/output, etc.)

Be sure to add a semicolon later

With?> The most recent statement can be without a semicolon, it is recommended to add semicolons

One is the structure definition statement (if/for/while/class/function, etc. with curly braces)

You must not add a semicolon behind.

1.3 Notes in the program

Single-line comment//

Script Comment #

Document Comments/*

*

*/

Multiline Comment/* */

Note: 1. Multiple lines of comments can no longer contain multiple lines of comments

2. Comments to be written on the top or right of the code

The role of annotations

1. Comment out the inappropriate code that was previously written

2. Write the Help document

3. Debug program

There are some programming specifications commonly used in PHP: http://www.cnblogs.com/mo-beifeng/archive/2011/10/11/2207187.html

  • 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.