Skip to content

Instantly share code, notes, and snippets.

@haykuro
Created May 2, 2013 00:02
Show Gist options
  • Save haykuro/5499301 to your computer and use it in GitHub Desktop.
Save haykuro/5499301 to your computer and use it in GitHub Desktop.
<?php
// In response to: http://www.reddit.com/r/PHPhelp/comments/1ddwod/im_a_total_noob_here_is_my_problem_i_am_required/
$val = array(
array("Time", "10AM ", "11AM", "12AM","1PM"),
array("Pigs Kilt","100","200"),
array("Pigs Rubbed","300","400"),
);
echo "<table>".
"<tbody>";
for($i = 0; $i < count($val); $i++)
{
echo '<tr>';
for($ii = 0; $ii < count($val[$i]); $ii++)
{
if($ii === 0)
{
echo "<td><strong>{$val[$i][$ii]}</strong></td>";
}
else
{
echo "<td>{$val[$i][$ii]}</td>";
}
}
echo '</tr>';
}
echo "</tbody>".
"</table>";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment