Home >Backend Development >PHP Problem >What does .= in php mean?
".=" in php represents the assignment operator, which means string concatenation. The usage syntax of this operator is such as "$string .= string2;", which can achieve the string splicing effect.
The operating environment of this article: Windows 7 system, PHP version 7.1, DELL G3 computer
php.=What does it mean?
The meaning of .= in PHP:
.=
The meaning of string concatenation in PHP
For example:
$a = 'a'; $a .= 'bc'; $a = 'abc';
Similar = -= *= /=
That is to say
$a = 'a'.'bc'
When the value of variable $a is a
Execute $a .= 'bc'
The result is $a = 'abc'
When the value of variable $a is x
Execution$a .= 'bc'
The result is$a = 'xbc'
Recommended learning: "PHP video tutorial》
The above is the detailed content of What does .= in php mean?. For more information, please follow other related articles on the PHP Chinese website!