I'm trying to display a two column, four row CSV file in an HTML table. I have the code below, but it only displays the first row and I don't understand why.
<html>
<head>
<title>test</title>
</head>
<body>
<table border=1>
<?PHP
$file_handle = fopen("oee1.csv", "r");
while (!feof($file_handle) ) {
$line_of_text = fgetcsv($file_handle, 1024);
echo '<tr><td>' . $line_of_text[0] . '</td><td>' . $line_of_text[1] . '</td></tr>';
}
fclose($file_handle);
?>
</table>
</body>
</html>
The csv file looks like:
test1, 1
test2, 2
test3, 3
test4, 4
fgetcsv
itself.