loops – How to concat string in PHP-ThrowExceptions

Exception or error:

I want to do like this:

$string = "";
$string += "lol"; //maybe =+  > tried but both not working

But it isn’t working, anyone suggestions?
Google isn’t making my life easy (cant search characters like = or +)

How to solve:

In PHP, string concatenation is done with the . operator:

$string .= 'lol';

+ is for addition.


$str = "";
$str .= "lol.";

Input or place the ellipses with your loop condition, += is an add and increment operator.

Leave a Reply

Your email address will not be published. Required fields are marked *