我有一個方法需要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