I need to include within a php page, one .txt file lets say roster.txt or roster.csv which is tab or comma delimited. when i show it, i need it to show in a table again just like it was shown in excel when made
would be great to be able to have ever second line shaded ill write css classes but the php needs to identify them.. can you help? this is a non proffit website
<?php
$row = 1;
if (($handle = fopen("user_texts/roster.csv", "r")) !== FALSE) {
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$num = count($data);
echo "<p> $num fields in line $row: <br /></p>\n";
$row++;
<tr> for ($c=0; $c < $num; $c++) {
<td>echo $data[$c]</td> . "\n";</tr>
}
}
fclose($handle);
}
?>
has an error in it im not sure what the inner loop is, </tr> is meant to be after it.....
would be great to be able to have ever second line shaded ill write css classes but the php needs to identify them.. can you help? this is a non proffit website
<?php
$row = 1;
if (($handle = fopen("user_texts/roster.csv", "r")) !== FALSE) {
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$num = count($data);
echo "<p> $num fields in line $row: <br /></p>\n";
$row++;
<tr> for ($c=0; $c < $num; $c++) {
<td>echo $data[$c]</td> . "\n";</tr>
}
}
fclose($handle);
}
?>
has an error in it im not sure what the inner loop is, </tr> is meant to be after it.....