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