summaryrefslogtreecommitdiffstats
path: root/examples/json.php
diff options
context:
space:
mode:
authorignace nyamagana butera <nyamsprod@gmail.com>2015-12-11 10:28:14 +0100
committerignace nyamagana butera <nyamsprod@gmail.com>2015-12-11 10:28:14 +0100
commit0a1b535df48507f58ed3c7ab44e72272b11163ac (patch)
tree516c4f68d24eb0b10e47a6abfbbdca694b0dbfb8 /examples/json.php
parent630f69081696cbb091338086724f809472a7ee79 (diff)
downloadcsv-0a1b535df48507f58ed3c7ab44e72272b11163ac.zip
csv-0a1b535df48507f58ed3c7ab44e72272b11163ac.tar.gz
csv-0a1b535df48507f58ed3c7ab44e72272b11163ac.tar.bz2
Update examples for version 8.08.0.0
Diffstat (limited to 'examples/json.php')
-rwxr-xr-xexamples/json.php2
1 files changed, 2 insertions, 0 deletions
diff --git a/examples/json.php b/examples/json.php
index b86826e..60cddc8 100755
--- a/examples/json.php
+++ b/examples/json.php
@@ -7,6 +7,8 @@ require '../vendor/autoload.php';
$inputCsv = Reader::createFromPath('data/prenoms.csv');
$inputCsv->setDelimiter(';');
$inputCsv->setEncodingFrom('ISO-8859-15');
+//we limit the output to max. 10 rows
+$inputCsv->setLimit(10);
$res = json_encode($inputCsv, JSON_PRETTY_PRINT|JSON_HEX_QUOT|JSON_HEX_TAG|JSON_HEX_AMP|JSON_HEX_APOS);
if (JSON_ERROR_NONE != json_last_error()) {
die(json_last_error_msg());