10-30-2009, 08:16 PM
|
#11 (permalink)
|
|
Moderateur
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
|
That data is different to what you posted earlier and is indeed a normal CSV file. How are you parsing the data? fgetcsv should have no problem with it at all.
Does this work?
PHP Code:
<?php
$fp = fopen("mycsvfile.txt","r");
$rows = array();
while (($row = fgetcsv($fp)) !== FALSE) {
$rows[] = $row;
}
fclose($fp);
?>
<table>
<thead>
<tr>
<td>Name</td>
<td>ID</td>
</tr>
</thead>
<tbody>
<?php foreach ($rows as $row) : list($name, $id) = $row; ?>
<tr>
<td><?php echo $name; ?></td>
<td><?php echo $id; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
|
|
|
|