mirror of
https://github.com/parsecsv/parsecsv-for-php.git
synced 2026-02-19 08:36:39 +00:00
conditions, limit and offset are functional. conditions needs a rewrite tho.
added examples to trunk. git-svn-id: http://parsecsv-for-php.googlecode.com/svn/trunk@13 339761fc-0c37-0410-822d-8b8cac1f6a97
This commit is contained in:
21
examples/limit.php
Normal file
21
examples/limit.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<pre>
|
||||
<?php
|
||||
|
||||
require_once('../parsecsv.lib.php');
|
||||
|
||||
$csv = new parseCSV();
|
||||
|
||||
# if sorting is enabled, the whole CSV file
|
||||
# will be processed and sorted and then rows
|
||||
# are extracted based on offset and limit
|
||||
$csv->sort_by = 'title';
|
||||
|
||||
$csv->limit = 3;
|
||||
$csv->offset = 2;
|
||||
|
||||
$csv->auto('books.csv');
|
||||
|
||||
print_r($csv->data);
|
||||
|
||||
?>
|
||||
</pre>
|
||||
Reference in New Issue
Block a user