There are two string operators. The first is the concatenation operator ('.'), which returns the concatenation of its right and left arguments. The second is the concatenating assignment operator ('.='), which appends the argument on the right side to the argument on the left side. Please read Assignment Operators for more information.
There are only two string operators in PHP: concatenation and shorthand concatenation.
|.||Concatenation||Returns the second value appended to the first: $a . $b|
|.=||Shorthand concatenation||Appends the second value to the first: $a .= $b|
<?php $a = "Hello "; $b = $a . "World!"; // now $b contains "Hello World!" $a = "Hello "; $a .= "World!"; // now $a contains "Hello World!" ?>
<?php $txt1 = "Hello"; $txt2 = " world!"; echo $txt1 . $txt2; ?>
<?php $txt1 = "Hello"; $txt2 = " world!"; $txt1 .= $txt2; echo $txt1; ?>