Thanks. I have this code to drop rows that I do not need, [2], [3],[6]. Which I was able to do in this code, however, I would like to offset each row with a different color (horizontally) and the arrays seem to be populating the table vertically (along with color)... thoughts? Thanks.
For some reason the color for the offset "row" colors is not coming out right in html - when it displays. Its been a while since I've coded, please feel free to give advice or clean up suggestions... thanks.
Code:
<?php
$count = 1;
$input = 'https://www.fdic.gov/bank/individual/failed/banklist.csv';
echo "<html><body><table border=1 width=250>";
echo "<th bgcolor=#222937><FONT COLOR=WHITE FACE=Geneva, Arial SIZE=3>Bank Name</FONT></th>";
echo "<th bgcolor=#222937><FONT COLOR=WHITE FACE=Geneva, Arial SIZE=3>City</FONT></th>";
echo "<th bgcolor=#222937><FONT COLOR=WHITE FACE=Geneva, Arial SIZE=3>Acq. Institution</FONT></th>";
echo "<th bgcolor=#222937><FONT COLOR=WHITE FACE=Geneva, Arial SIZE=3>Closing Date</FONT></th>";
if (false !== ($ih = fopen($input, 'r')))
{
fgetcsv($ih);
while (false !== ($data = fgetcsv($ih)))
{
$outputData = array($data[0], $data[1], $data[4], $data[5]);
echo "<tr>";
foreach ($outputData as $row)
{
if($count % 2 == 0)
$rowColor = '#0066FF';
else
$rowColor = '#222937';
echo "<td bgcolor= .$rowColor.><FONT COLOR=D3AB04 FACE=Geneva, Arial SIZE=2>" . htmlspecialchars($row) . "</FONT></td>";
$count++;
}
}
fclose($ih);
echo "</table></body></html>";
}
?>