Jump to content

[SOLVED] Array values outside of the table


MasterACE14

Recommended Posts

For some reason my array elements are on the outside of my table, http://www.crikeygames.com.au/conflictingforces/index.php?page=encyclopedia

 

can someone tell me why?

 

heres the code:

<?php // encyclopedia 

/* includes */
include '/home/ace/public_html/conflictingforces/weapons.php';
?>

<div id = "encyclopedia">
<center><b><u>Encyclopedia</u></b><br></center>
<center>

            


            
	<?php /* Grab weapon Array and Display it */

echo "<h1>Using foreach loop to display elements</h1>";



for ($row = 0; $row < 3; $row++)
{
echo "<table class=\"fix\">";
echo "<tr><td colspan='2'>Weapon</td></tr>";


    foreach($weapons[$row] as $key => $value)
    {

	echo "<td>";
        echo "<tr>".$key."</tr>";
	echo "</td>";

	echo "<td>";
        echo "<tr>".$value."</tr>";
	echo "</td>";

    }

}

echo "</table>";

?>



	</center>

</div>

 

Regards ACE

Link to comment
https://forums.phpfreaks.com/topic/69537-solved-array-values-outside-of-the-table/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.