答案 0 :(得分:2)
更改此行...
echo '<h1><b>You scored $score out of $totalScore </b> </h1>';
对此......
echo '<h1><b>You scored'. $score .' out of '. $totalScore. '</b> </h1>';
答案 1 :(得分:2)
在此处使用双引号""
-
echo "<h1><b>You scored $score out of $totalScore</b> </h1>";
或像这样拆分 -
echo '<h1><b>You scored '.$score.' out of '.$totalScore.'</b> </h1>';