Php learning code Biography-php Tutorial

Source: Internet
Author: User
Php learning code note 16222 string join (1) join operator (& ldquo;. & rdquo;): it returns the string obtained after attaching the right parameter to the left parameter. (2) join value assignment operator (& ldquo;. & rdquo;): attaches the parameter on the right to the parameter on the left. It is equivalent to + in JS. $ B East Sunrise West rain; $ B., the road is not clear but clear; php learning code note

16/2/22

String connection

(1) concatenation operator ("."): it returns the string obtained after attaching the right parameter to the left parameter.

(2) join value assignment operator (". ="): It attaches the parameter on the right to the parameter on the left.

It is equivalent to ++ = in JS.

$ B = "East Sunrise West rain"; $ B. = ", the road is not clear but there is clear"; $ c = "East Sunrise West rain"; $ c = $ c. ", the road is not clear but clear"; echo $ B."
"; // East Sunrise West rain, road is no clear but clear echo $ c ."
"; // East Sunrise West rain, road is no clear but clear

Value assignment

$ A = "cmflovehxc ";
$ B = $;
$ C = & $;
$ A = "hxclovecmf ";

Echo $ B ."
";
Echo $ c;

(1) "=": assigns the value of the right expression to the number of operations on the left. It copies the expression value on the right to the number of operations on the left. In other words, I first applied a piece of memory for the number of operations on the left, and then put the copied value in the memory.

It is equivalent to the equal sign of JS. Variable assignment; two variables are two different heap memory.

(2) "= &": reference value assignment, meaning that both variables point to the same data. It will make the two variables share a piece of memory. if the data stored in this memory changes, the values of the two variables will change.

The two variables are two identical heap memory.

Constant

1 define ("PI1", 3.14); 2 $ p = "PI1"; 3 echo $ p; // PI1 4 echo constant ($ p ); // 3.14 5 if (defined ($ p) = true) {6 echo '000000'; 7} else {8 echo '000000'; 9} 10 // 111 is returned
11 // both constant () and defined () have a translation function.

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.