Recognition of the style of PHP4 marker

Source: Internet
Author: User
PHP4 style of marking

1.XML style

<?phpecho "This is an XML style tag";? >

2. Scripting style

<script language= "php" >echo "This is a script style tag";</script>

3. Short style

<?echo "This is a short style tag";? >

4.ASP style

<%echo "This is an ASP style tag";%>

Comments

Single line://

Multiple lines:/*............*/

Scalar data types

Boolean (Boolean): Only 2 values, True (True) and False (false)

String (String type): Sequential string sequence

Integer (Integer): contains only integers

Float (floating point type): Real number

$ is a scalar identifier, and all variables start with the $ sign

3 Ways to define strings

1. Single quotation mark (')

<?php$a= ' strings ';? >

2. Double quotation marks (")

<?php$a= "string";? >

3. Delimiter (<<<)

<?php$string=<<<str string str    //End qualifier must be another line?>

The difference between single and double quotes: single quotation marks are output by ordinary characters, and double quotes are the variables that are included replace them with actual values.

Escape character output extra "\"

Such as:

<?php$a= "string"; echo "\ $a"; echo "$a";? >

Output result: $a

Character connections (similar to Java (Java is +, here is.))

Such as:

<?php$a= "word"; echo "Hello". $a;? >

Output Result: Hello Word

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.