Home >Backend Development >PHP Problem >php .= what does it mean

php .= what does it mean

Guanhui
GuanhuiOriginal
2020-05-05 15:59:599215browse

php .= what does it mean

php .=What does it mean

In PHP, the .= symbol is called the connection assignment operator and is used to connect two or multiple strings, and it is different from the "." connection operator in that it splices the right parameter to the left parameter and assigns it to the left parameter.

String operators

There are two string operators. The first is the concatenation operator ("."), which returns the concatenated string of its left and right arguments. The second is the concatenation assignment operator (".="), which appends the right argument to the left argument.

<?php
$a = "Hello ";
$b = $a . "World!"; // now $b contains "Hello World!"

$a = "Hello ";
$a .= "World!";     // now $a contains "Hello World!"
?>

The above is the detailed content of php .= what does it 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