|
Posted by Rik on 06/24/06 13:03
Rik wrote:
> Seeing as you know the number of array-elements here, replace with:
> $rowhtml ='
> <tr>
> <td>%s</td>
> <td>%s</td>
> <td>%s</td>
> <td align="right">%s</td>
> </tr>';
> while(($row = fgetcsv($csvHandle, filesize($csvFile))) !== false){
> $this->html = vsprintf($rowhtml, $row);
> }
Or, if you don't know the number of array-elements, for future use:
$rowbegin ='
<tr>';
$rowbetweeen = '
<td>%s</td>';
$rowend = '
<td align="right">%s</td>
</tr>';
while(($row = fgetcsv($csvHandle, filesize($csvFile))) !== false){
$this->html =
vsprintf($rowbegin.str_repeat($rowbetween,count($row)-1).$rowend, $row);
}
Grtz,
--
Rik Wasmus
Navigation:
[Reply to this message]
|