Pregunta

I have a CSV file with this information: CSV Link

As you can see it is a lot of data here, and I am asking if it is possible to convert some of the data to a table in HTML. Like if I only would convert the data in "Kamp" "Række" "Navn1" "Navn2" and "Resultat"

Would it be possible or do I need to convert everything to html? I have not access to edit the CSV file because it automatically imports new data.

Hopefully there are someone with a gifted mind here who has the solution. If anything is not clear then please ask me.

¿Fue útil?

Solución

You can start from here, you'll have the data of each row inside a php array, then you can echo what you want inside html.

<table>
<?php 
     $handle=fopen('filename.csv', r);
     while($data=fgetcsv($handle, 1000, ';', '"')){?>
           <tr>
               <td><?php echo $data[0];?></td>
               <td><?php echo $data[1];?></td>
               <td><?php echo $data[2];?></td>
               <td><?php echo $data[3];?></td>
           </tr>
<?php }
     fclose($handle);
?>
</table>

But I see you have too many " in your csv file.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top