Home >Backend Development >PHP Problem >What does .= in php mean?

What does .= in php mean?

藏色散人
藏色散人Original
2021-10-28 11:57:555868browse

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

What does .= in php mean?

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn