次のphpコード:
<?php
$fopen = fopen("tasklistout.csv","r");
while(!feof($fopen))
{
$line = fgets($fopen);
echo "\r\n\t<tr>";
$piece_array = preg_split("/[\s,]+/",$line);
for ($forvar = 1; $forvar <= 5; $forvar++)
{
$array_index = $forvar - 1;
echo "\r\n\t\t<td>" . $piece_array[$array_index] . "</td>";
}
echo "\r\n\t</tr>\r\n";
}
fclose($fopen);
?>
次のエラーが発生します: (4 回に分けて)
注意: 未定義のオフセット: 33 行目の file.php の 1
次の HTML ドキュメントでは:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Lab_11-Objective_01--Tables</title>
<meta name="description" content="HTML 'table' element usage for Lab 11 Objective 01">
<meta name="author" content="Charles E Lentz">
<link rel="stylesheet" href="stylesheet.css">
</head>
<body>
<table>
<tr>
<th>Image Name</th>
<th>PID</th>
<th>Session Name</th>
<th>Session#</th>
<th>Mem Usage</th>
</tr>
<?php
$fopen = fopen("tasklistout.csv","r");
while(!feof($fopen))
{
$line = fgets($fopen);
echo "\r\n\t<tr>";
$piece_array = preg_split("/[\s,]+/",$line);
for ($forvar = 1; $forvar <= 5; $forvar++)
{
$array_index = $forvar - 1;
echo "\r\n\t\t<td>" . $piece_array[$array_index] . "</td>";
}
echo "\r\n\t</tr>\r\n";
}
fclose($fopen);
?>
</table>
</body>
</html>
このエラーを修正するにはどうすればよいですか?