append string with number php code example
Example 1: php concat
$a = "hello";
$b = "world";
$c = $a . " " . $b;
echo $c; // hello world
Example 2: add more data to variable php
$a = "Hello ";
$a .= "World!";
Example 3: Adding string with number in php
$a = "3dollars";
$b = 20;
echo $a += $b;
print($a += $b);
------------------------------
It casts '3dollars' as a number, getting $a = 3.
When you echo, you add 20, to $a, so it prints 23 and $a = 23.
Then, when you print, you again add 20, so now $a = 43.