$a = \公众2\"大众;

$b = 2;

$c = $a + $b;

php数字可以相加吗php字符串相加含非数字的字符相加 jQuery

var_dump($c);//4

---------------------------------------

$a = \公众2abcd\"大众;

$b = 2;

$c = $a + $b;

var_dump($c);//4

---------------------------------------

$a = \"大众abcd2\"大众;

$b = 2;

$c = $a + $b;

var_dump($c);//2

---------------------------------------

$a = \"大众2.1abcd2\"大众;

$b = 2;

$c = $a + $b;

var_dump($c);//4.1