What is the difference between these in php | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What is the difference between these in php

One has dot and the other doesn't. I have seen this several times but i have not been able to figure out the role of the dot(.) Before the equal sign

18th Nov 2020, 9:35 AM
Balogun Soliu
2 Answers
+ 5
It's a concatenation assignment operator for strings. $txt1 = "Hello, " $txt2 = "World!" $txt1 .= $txt2 echo $txt1 // "Hello, World!" https://www.w3schools.com/php/php_operators.asp
18th Nov 2020, 9:44 AM
ChaoticDawg
ChaoticDawg - avatar
+ 2
Thanks bro
18th Nov 2020, 7:20 PM
Balogun Soliu