在echo-php中求和


Sum in echo php

由于PHP的行为,我有点气馁。为什么PHP以这种方式解释我的代码:

echo "We has over " . 2500 + 500 . " employees over the world"; // 500 employees over the world

您也可以将上述代码更改为:

<?php
$sum=2500 + 500;
echo "We has over " . $sum . " employees over the world";
?>