How to use a foreachloop to place the array data in table
<p>I keep getting the error: Parse error: syntax error, unexpected 'sNameâ€' (T_STRING), expecting ']'on line 5 I need some help solving this problem. Could anyone tell me what's wrong with my code?</p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;?php
$data = array [
                ["sName” =&gt; “Gervase”, "sNumber" =&gt; "s1234567", "mark” =&gt; 95, “comments” =&gt; “Well done!”],
                ["sName” =&gt; “Matt”, "sNumber" =&gt; "s1234567", "mark” =&gt; 95, “comments” =&gt; “Well done!”],
                ["sName” =&gt; “Kid”, "sNumber" =&gt; "s1234567", "mark” =&gt; 95, “comments” =&gt; “Well done!”],
                ["sName” =&gt; “Nathan”, "sNumber" =&gt; "s1234567", "mark” =&gt; 85, “comments” =&gt; “Well done!”]
  ]
?&gt;
&lt;html&gt;
&lt;head&gt;
    &lt;link type='text/css' rel='stylesheet' href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"/&gt;
&lt;/head&gt;
    &lt;body&gt;
        &lt;div&gt;
            &lt;div class="jumbotron"&gt;
                 &lt;div&gt;
                     &lt;div class="container"&gt;
                         &lt;h1&gt;Data&lt;/h1&gt;
                 &lt;/div&gt;
                 &lt;div&gt;
                 &lt;div class="container"&gt;
                   &lt;table&gt;
                        &lt;table class="table"&gt;
                             &lt;thead&gt;  
                           &lt;?php

                            foreach ($data as $data)
                            {
                                echo"&lt;tr&gt;";
                                echo"&lt;td&gt;".$data["sName"]."&lt;/td&gt;";
                                echo"&lt;td&gt;".$data["sNumber"]."&lt;/td&gt;";
                                echo"&lt;/tr&gt;";
                            }
                            ?&gt;
                                 &lt;tr&gt;
                                   &lt;th&gt;Student number&lt;/th&gt;
                                   &lt;th&gt;Student name&lt;/th&gt;
                                   &lt;th&gt;Mark&lt;/th&gt;
                                   &lt;th&gt;Comments&lt;/th&gt;
                                 &lt;/tr&gt;
                                 &lt;tr&gt;
                                   &lt;td&gt;Something&lt;/td&gt;
                                 &lt;/tr&gt;
                             &lt;/thead&gt;
                   &lt;/table&gt;
                 &lt;/div&lt;
       &lt;/div&gt;
    &lt;/body&gt;
</code></pre>

<p></p>