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

What does .= in php mean?

藏色散人
Release: 2023-03-13 14:52:01
Original
5873 people have browsed it

".=" 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';
Copy after login

Similar = -= *= /=

That is to say

$a = 'a'.'bc'
Copy after login

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!

Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template