Php entry variable indirect reference, connection string, and connection assignment operator _ PHP Tutorial

Source: Internet
Author: User
Indirect reference, connection string, and join value assignment operator of variables in php getting started variables. [1] Indirect reference of a variable :? Php $ AB; $ a123; echo $ B ;? The above output is 123. we can see that $ is added in the second line of code, and the indirect reference of the variable [1] is accessed through the specified name:

 

The output above is 123

We can see that there is another $ in the second line of code, and the variable is accessed through the specified name, the specified name is stored in $ a ('B, change the value of $ B to 123. Therefore, such $ B variables are created and assigned values.

By adding the $ tag before the variable, you can increase the number of references at will.

[2] connection string: concatenates a string into a new merged string by using a concatenation operator (.) in English.

 

To give us a better understanding of the connection string, we changed it based on the above example (PHP5: powerful 2014)

In this example, quotation marks, spaces, and numbers are added. Below we will use two methods to write, the specific difference I found:

 

[3] join value assignment operator: if only one value is connected to another value, you can use the join value assignment operator (. = ). The following two statements are equivalent:

 

Why :? Php $ a = 'B'; $ a = '000000'; echo $ B ;? The above output is 123. we can see that $ is added to the second line of code and accessed by the specified name...

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.