I'm trying to write a function that that returns an table from an array. But, for some reason, it is only displaying the first row or the array instead of all.
<html>
<link rel="stylesheet" type="text/css" href="week13.css" />
</head>
<body>
<h2>table</h2>
<br>
<br>
<?php
$table = array("440" => "cubic inch engine","truck F" => 150);
echo ("<table border='1'>\n");
function t6($table)
{
foreach ($table as $key => $value)
return ("<tr><td>$key</td><td>$value</td></tr>\n");
}
echo t6($table);
echo "</table>";
?>
<br>
</body>
</html>