这个foreach应该被称为获取未定义的索引

I have an associative array below:

$questions = array();

while ($selectedstudentanswerstmt->fetch()) {           
    $questions[$detailsStudentId][$detailsQuestionId] = array(
        'questionno'=>$detailsQuestionNo,
        'content'=>$detailsQuestionContent
    );    
}

Now I want to display the info here in a for each loop but my question is what should the foreach loop be called because I believe below is incorrect as it keeps saying questionno and content is undefined in the loop:

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 
$questions[$detailsStudentId][$detailsQuestionId] = array(...)

You have two dimensions before your associative index kicks in. So you need to nest another foreach loop inside it:

foreach ($questions as $stundentId => $student)
{
    foreach ($student as $questionId => $question)
    {
        // ...
    }
}