what should this foreach be called as getting undefined index
<p>I have an associative array below:      </p>

<pre><code>$questions = array();

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

<p>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 <code>questionno</code> and <code>content</code> is undefined in the loop:</p>

<pre><code>var_dump($questions);
foreach ($questions as $questionId =&gt; $question) {

//LINE 571
    echo '&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; ' .htmlspecialchars($question['questionno']). ': '     .htmlspecialchars($question['content']) .  '&lt;/p&gt;' . PHP_EOL;
}

Notice: Undefined index: questionno in ... on line 571 
Notice: Undefined index: content in ... on line 571 
</code></pre>
