Cool idea. Something like;
<table>
<tr>
<td>flight num</td>
...
<td>deprt city</td>
<?php
// We are gonna loop each day of the week
for($dayofweek = 0; $dayofweek < 7; $dayofweek++)
{
// echo our column opening
echo '<td>';
// Check if $i (the current day of week) exists
if(substr_count($schedule->daysofweek, $dayofweek) > 0)
{
// there is a flight for sunday , so echo that plane icon out
echo 'plane icon';
}
// Close that column
echo '</td>';
}
?>
<td>arrival time</td>
...
</tr>
</table>
Some pseudo code,