以下に連想配列があります:
$questions = array();
while ($selectedstudentanswerstmt->fetch()) {           
    $questions[$detailsStudentId][$detailsQuestionId] = array(
        'questionno'=>$detailsQuestionNo,
        'content'=>$detailsQuestionContent
    );    
}
ここで、for eachループに情報を表示したいのですが、foreachループは何と呼ばれるべきかという質問です。これは、ループ内で定義されていないため、以下は正しくないquestionnoと考えているためです。content
var_dump($questions);
foreach ($questions as $questionId => $question) {
//LINE 571
    echo '<p><strong>Question:</strong> ' .htmlspecialchars($question['questionno']). ': '     .htmlspecialchars($question['content']) .  '</p>' . PHP_EOL;
}
Notice: Undefined index: questionno in ... on line 571 
Notice: Undefined index: content in ... on line 571