echo $s['name'] .": ". $result ."<br />\n";
That’s my code echoing $sitename[] : $result[]
Currently there are 3 sites that it echos.
However I want it to echo it like so:
<table>
<tr>
<td>$sitename[0]</td>
<td> </td>
<td>$result[0]</td>
</tr>
<tr>
<td>$sitename[1]</td>
<td> </td>
<td>$result[1]</td>
</tr>
<tr>
<td>$sitename[2]</td>
<td> </td>
<td>$result[2]</td>
</tr>
</table>
And then automatically add additional rows when I add a $site[3] and $site[4]
I’m not sure if this makes sense, if not, let me know and I’ll try to rephrase.
So you will echo out the tags, then inside do a for loop for each site, echo out the rest of the values that way.For Loop Information
So for example…
You can also look up for each loops if you are not sure how many sites you are adding, and want to create dynamic content.