Let me start by saying that i'm sorry if this is a complete noob question.
while using phpStorm, I have an array of $teams
and by invoking foreach
loop I tried to put each of the array section into an HTML table
here is what I did so far
I am getting cannot use [] for reading
, I can't find an answer how to do that properly, thx in advance.
<table>
<tr>
<th>Team</th>
<th>ID</th>
</tr>
<?php
include dirname(__FILE__) . "/stats.php";
global $teams;
foreach ($teams['data'] as $team) {
echo "<tr>" ;
echo "<td> $team['name']</td>" ;
echo "<td> $team ['id']</td> " ;
echo "</tr>";
}
?>
</table>