I'm attempting to write a php code to use sample information in a multidimensional array, and output that info into an html table.
I am able to output the information but the formatting is way off, I feel as if there is some small issue and I need an extra pair of eyes.
Any help or advice is greatly appreciated.
My PHP code:
<html>
<head>
</head>
<body>
<table border="1px">
<?php
$karma_score = Array( "UserID" => Array(1,2,3,4),
"NameID" => Array('Doe','Smith','Chan','Zee'),
"Karma" => Array(45,123,1,15),
"LastLogin" => Array("2012-08-30","2012-09-02","2011-12-23","2012-07-01"));
echo "<tr>";
foreach($karma_score as $key => $value){
echo "<td>" . $key . "</td>";
}
echo "</tr>";
echo "<tr>";
foreach($karma_score as $key=> $value){
echo "<td>";
foreach($value as $something){
echo $something;
}
echo "</td>";
}
echo "</tr>";
?>
</table>
</body>
</html>