📜  在 php 代码示例中添加带数字的字符串

📅  最后修改于: 2022-03-11 14:53:54.303000             🧑  作者: Mango

代码示例1
$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.