$emptyStr = ".........";
$whichwrong .= "{$Ss[$s]}\n";
$whichwrong .= $emptyStr . "Question: $questionNum || Answer: {$userAnswers[$s][$q]}\n";
打印出来:
1. Medication Errors:
.........Question: 2 || Answer: b
.........Question: 4 || Answer: b
2. About Restraints:
.........Question: 3 || Answer: c
3. About Pain Assessment And Management:
.........Question: 2 || Answer: c
.........Question: 3 || Answer: b
4. About Universal Protocol:
.........Question: 1 || Answer: b
.........Question: 2 || Answer: b
我正在寻找空间而不是“。” 我做了以下但没有奏效:
$emptyStr = "";
$whichwrong .= str_pad($emptyStr, 10) . "Question: $questionNum || Answer: {$userAnswers[$s][$q]}\n";
但它不包括“问题...”之前的 10 个空格。
知道如何解决吗?
更新[已解决]:我使用了以下内容并且它有效:
$whichwrong .= "<span style='padding-left: 25px;'></span>" . "Question: $questionNum || Answer: {$userAnswers[$s][$q]}\n";