This is happening because of the type casting issues. 3 . "
"
will be converted to number while the operation will be performed. Wrap the inside ()
so that the operations are performed first then the concatenation.
echo "Addition = " . ($var1 += 3) . "
";
echo "Subtraction = " . ($var1 -= 3) ."
";
echo "Addition = " . ($var1 *= 3) . "
";
echo "Addition = " . ($var1 /= 3) ."
";