summaryrefslogtreecommitdiffstats
path: root/examples/table.php
blob: 6e567819b746b8fcb78ccaaf8f3cb87272b1c7ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php

use League\Csv\Reader;

require '../vendor/autoload.php';

$inputCsv = Reader::createFromPath('data/prenoms.csv');
$inputCsv->setDelimiter(';');
$inputCsv->setEncodingFrom("iso-8859-15");
$inputCsv->setLimit(30); //we are limiting the convertion to the first 31 rows
?>
<!doctype html>
<html lang="fr">
<head>
    <meta charset="utf-8">
    <title>Using the toHTML() method</title>
    <link rel="stylesheet" href="example.css">
</head>
<body>
<?=$inputCsv->toHTML('table-csv-data with-header');?>
</body>
</html>