summaryrefslogtreecommitdiffstats
path: root/examples/example05.php
diff options
context:
space:
mode:
authorIgnace Nyamagana Butera <nyamsprod@gmail.com>2014-02-07 09:44:37 +0100
committerIgnace Nyamagana Butera <nyamsprod@gmail.com>2014-02-07 09:44:37 +0100
commitbfb61f0f466bba7df3fbc09208a4f40c3460276b (patch)
treefc2576d171d7e3a21d23be140f6261eee1c5896a /examples/example05.php
parent49f0de4e04c074eae1672fe6dc89717ac271cc64 (diff)
downloadcsv-bfb61f0f466bba7df3fbc09208a4f40c3460276b.zip
csv-bfb61f0f466bba7df3fbc09208a4f40c3460276b.tar.gz
csv-bfb61f0f466bba7df3fbc09208a4f40c3460276b.tar.bz2
bug fix AbstractCsv::createFromString and Writer::insertOne to better works with string conversion
Diffstat (limited to 'examples/example05.php')
-rw-r--r--examples/example05.php18
1 files changed, 0 insertions, 18 deletions
diff --git a/examples/example05.php b/examples/example05.php
index e98a2e9..74cbffc 100644
--- a/examples/example05.php
+++ b/examples/example05.php
@@ -37,17 +37,6 @@ $headers = $inputCsv->fetchOne(0);
$writer = new Writer(new SplTempFileObject); //because we don't want to create the file
$writer->insertOne($headers);
$writer->insertAll($res);
-
-//we create a Reader object from the Writer object to filter the resulting CSV
-$reader = $writer->getReader();
-$names = $reader
- ->setFilter(function ($row, $index) {
- return $index > 0; //we don't want to select the header
- })
- ->setSortBy(function ($row1, $row2) {
- return strcmp($row1[0], $row2[0]); //we are sorting the name
- })
- ->fetchCol(0); //we only return the name column
?>
<!doctype html>
<html lang="fr">
@@ -64,13 +53,6 @@ $names = $reader
<?=$writer?>
</pre>
<p><em>Notice that the delimiter have changed from <code>;</code> to <code>,</code></em></p>
-<h3>Here's the firstname ordered list</h3>
-<ol>
-<?php foreach ($names as $firstname) : ?>
- <li><?=$firstname?>
- <?php
-endforeach;
-?>
</ol>
</body>
</html>