我有一个方法需要3个数组作为参数,然后根据传递的3个数组的值创建一个数组。这个信息然后被发送到发送它的电子邮件方法。迄今为止它一直工作得很好。问题是我的关键值配对。有些值不是打印的,我不知道为什么。为了说明的目的,我省略了无关的代码。看看...打印阵列信息
public function SendToISS($user,$questions,$scores_translated) {
$userinfo = array("First Name:"=>$user['first'],
"Last Name:"=>$user['last'],
"Organization:"=>$user['org'],
"State:"=>$user['state'],
"Zip:"=>$user['zip'],
"Phone:"=>$user['phone'],
"Email:"=>$user['email'],
""=>"",
"Assessment Answers:"=>"",
"Assessment One:"=>$questions[0],
" ".$user['first']."'s Answer:"=>$scores_translated[0],
"Assessment Two:"=>$questions[1],
" ".$user['first']."'s Answer:"=>$scores_translated[1],
"Assessment Three:"=>$questions[2],
" ".$user['first']."'s Answer:"=>$scores_translated[2],
"Assessment Four:"=>$questions[3],
" ".$user['first']."'s Answer:"=>$scores_translated[3],
"Assessment Five:"=>$questions[4],
" ".$user['first']."'s Answer:"=>$scores_translated[4]
);
}
这是我的电子邮箱中的结果。 scores_translated数组只是打印第一个值,然后停止。
First Name: Steven
Last Name: Pepe
Organization: Laerdal
State: New York
Zip: 12590
Phone: 8452977770
Email: [email protected]
Assessment Answers:
Assessment One: Administer multiple assessments of student progress throughout the class.
Steven's Answer: The program does not perform this strategy.
Assessment Two: Establish a passing standard for psychomotor and critical thinking skills that is above the minimum competency level.
Assessment Three: The program does not perform this strategy.
Assessment Four: Assure instructional consistency when preparing students for the NREMT-B exam.
Assessment Five: Provide immediate feedback for written, practical evaluations to students.
请指定_what_丢失。 –
@SergiuParaschiv我希望每个问题都能看到“Steven's Answer:”一次。我不知道,为什么没有打印。 – zebediah49
缺少的是“评估一:”之后的其他键值对。他们也应该包含分数。你可以在电子邮件结果中看到这一点。 – stevenpepe