Code:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
<?php
$table = array ("1", "2", "3", "4", "5");
$count = count($tablet);
echo "<table border='1'>";
$rows = 6;
for($i=0; $i <= $count; $i = $i + $rows)
{
echo "<tr>";
for($z = 0; $z < $rows; $z++)
{
if ($table[$i + $z] !=0)
echo "<td>This is row {$table[$i + $z]}</td></tr>";
else
echo "<td> </td></tr>";
}
}
echo "</table>";
?>
</body>
</html>
Code:
Notice: Undefined offset: 5 in [file location] on line 22
Comment