我對這兩位代碼的格式有什麼不妥?PHP - 在var上添加混合字符串和變量?
如何格式化字符串和變量的混合以給我正確的輸出?
$inbody = 60;
$body = "Welcome. For about " . $inbody . "-" . $inbody+15 . " minutes, you'll receive SMS messages." ;
我可以做那樣的內聯嗎?或者是我唯一的解決方案來聲明另一個變量並將其放入?像:
$addedinbody = $inbody + 15 ;
這裏是另一個有麻煩(具體設置$ body變量)例如IM:
for ($i=0; $i<=$duration; $i++){
$body = $i+1 . "/" . $duration+1 . " " . $task[$newtask];
}