PHP Learning Code notes, PHP code notes _php Tutorial

Source: Internet
Author: User

PHP Learning Code notes, PHP code essays


16/2/22

String connection

(1) Join operator (".") : It returns the string that is appended to the right argument after the left argument.

(2) Connection assignment operator (". ="): It attaches the right argument to the left argument.

Equivalent to JS inside the + =.

        $b = "East Sunrise West Rain";         $b . = ", the road is not clear but there is fine";         $c = "East Sunrise West Rain";         $c $c. "The road is not clear but there is fine"    ; Echo  $b. "
"; // East Sunrise West Rain, road is not clear but there is clear Echo $c. "
"; // East Sunrise West Rain, road is not clear but there is clear

Assignment operations

$a = "Cmflovehxc";
$b = $a;
$c =& $a;
$a = "HXCLOVECMF";

echo $b. "
";
Echo $c;

(1) "=": assigns the value of the right expression to the left operand. It copies the value of the right expression to the left-hand operand. In other words, the left operand is first requested for a piece of memory, and then the copied value is placed in this memory.

Equivalent to JS equals sign. variable assignment; Two variables are two different heap memory.

(2) "=&": Reference assignment means that both variables point to the same data. It will allow two variables to share a piece of memory, and if the memory stored data changes, then the values of the two variables will change.

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 ' 111 '    7 }else{  8  echo ' 222 '; 9 }// return 111
One//constant () and defined () have a translation function

http://www.bkjia.com/PHPjc/1101615.html www.bkjia.com true http://www.bkjia.com/PHPjc/1101615.html techarticle PHP Learning Code notes, PHP code notes 16/2/22 string Connection (1) Join operator (.) : It returns the string that is appended to the right argument after the left argument. (2) Connection assignment Operation ...

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