This is my code. I don't know why it is not working. I was trying to print my table with php for loop, but nothing shows up on the website.Nothing
This is the two-dimentional array that I was trying to print out.
<!--Arrays of weapons-->
<?php
$weapons = array(
array("M4A1",1,78906,"TUCKER, LISBETH","SPC"),
array("M4A1",2,78915,"HATHAWAY, HANNAH","1LT"),
array("M4A1",3,78933,"HARRIS, LEE","SFC"),
array("M4A1",4,78934,"WELCH, BRAD","SSG"),
array("M9",1,1167552,"BLAND, MARGARET","CPT"),
array("M249",1,101032,"TYSON, MICHELLE","1SG"),
array("M249",2,101038,"MEDINA, TOBIAS","SPC"),
array("M240B",1,104104,"COSTA, JOSHUA","SSG"),
array("M2A1",1,1863848,"GARCIA, RIGOBERTO","SSG"),
array("MK-19",1,19369,"NEUPANE, KISHOR","SPC")
);
?>
This is the code that I was trying to use to print out.
<!--Create the Weapons List Table-->
<table border ="1">
<tr>
<th>Type</th>
<th>Buttstock #</th>
<th>Serial #</th>
<th>Name</th>
<th>Rank</th>
</tr>
<!--Put two-dimentinal arrays in the table-->
<?php foreach ($row = 0; $row < 10, $row++) {?>
<tr>
<?php for ($col = 0; $col < 5, $col++) {?>
<td><?php echo $weapons[$row][$col];?></td>
<?php }?>
</tr>
<?php }?>
</table>
