PHPackages                             pllano/csv - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PDF &amp; Document Generation](/categories/documents)
4. /
5. pllano/csv

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

pllano/csv
==========

Read very large CSV files in parts

1.0.2(8y ago)09MITPHPPHP &gt;=5.3.0

Since Dec 11Pushed 8y ago1 watchersCompare

[ Source](https://github.com/pllano/csv)[ Packagist](https://packagist.org/packages/pllano/csv)[ Docs](https://github.com/pllano/csv)[ RSS](/packages/pllano-csv/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Pllano CSV Reader
=================

[](#pllano-csv-reader)

[![Latest Version](https://camo.githubusercontent.com/5f14d70931d4b0b3f13f2fec7c6acdf800297e2340a4676916e3e3682fb25938/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f706c6c616e6f2f6373762e7376673f7374796c653d666c61742d737175617265)](https://github.com/pllano/csv/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

Read large data from csv files in parts in php

System Requirements
-------------------

[](#system-requirements)

You need \**PHP &gt;= 5.3*

Install
-------

[](#install)

Install `Csv Reader` using Composer.

```
$ composer require pllano/csv

```

or in composer.json

```
"require": {
	"pllano/csv": "1.0.2"
}

```

Fast start =&gt; tests/FastStart.php
------------------------------------

[](#fast-start--testsfaststartphp)

Save the above code fragment as `test.php` in your Web root folder.

```
require 'vendor/autoload.php';
//	require_once '/vendor/pllano/csv/src/Reader.php';
//	require_once __DIR__.'/src/Reader.php';

$filename = 'test.csv';

$csv = new Pllano\Csv\Reader($filename);

$records = $csv->Read();

$count = count($records);
if ($count >= 1) {
	foreach ($records as $item) {

		print_r($item);
		print_r('');

	}
}
```

Read one line =&gt; tests/ReadOneLine.php
-----------------------------------------

[](#read-one-line--testsreadonelinephp)

```
require 'vendor/autoload.php';
//	require_once '/vendor/pllano/csv/src/Reader.php';
//	require_once __DIR__.'/src/Reader.php';

$filename = 'test.csv';

$csv = new Pllano\Csv\Reader($filename);

$csv->setItemStart(10);
$csv->setExecute(1);

$records = $csv->Read();

print_r($records);

/*
Array
(
	[0] => Array
	(
	[name] => Lorem
	[number] => 11
	[price] => 22.00
	)
)
*/
```

Real Line Key =&gt; tests/RealLineKey.php
-----------------------------------------

[](#real-line-key--testsreallinekeyphp)

```
require 'vendor/autoload.php';
//	require_once '/vendor/pllano/csv/src/Reader.php';
//	require_once __DIR__.'/src/Reader.php';

$filename = 'test2.csv';

$csv = new Pllano\Csv\Reader($filename);

$csv->setItemStart(10); // start item - default: 1
$csv->setExecute(50); // amount - default: 0

$records = $csv->Read();

$item_start = $csv->getItemStart(); // returns 0

$count = count($records);
if ($count >= 1) {
	foreach ($records as $key => $item) {

	$real_key = $key + $item_start;

		print_r($real_key);
		print_r(' - ');
		print_r($item);
		print_r('');

	}
}
```

Example =&gt; tests/ReadRefresh.php
-----------------------------------

[](#example--testsreadrefreshphp)

```
function clean($value = '')
{
	$value = trim($value);
	$value = stripslashes($value);
	$value = strip_tags($value);
	$value = htmlspecialchars($value, ENT_QUOTES);
	//	$value = htmlentities($value);
	return $value;
}

$filename = 'test.csv';
$start = 0;
$rows_total = 0;

if ($_GET["filename"]) {$filename = clean($_GET["filename"]);}
if ($_GET["start"]) {$start = clean($_GET['start']);}

//	Include Composer autoloader if not already done.
require 'vendor/autoload.php';
//	require_once '/vendor/pllano/csv/src/Reader.php';
//	require_once __DIR__.'/src/Reader.php';

$csv = new Pllano\Csv\Reader($filename);

//	$csv->setDelimiter(';'); // default: ;
//	$csv->setEnclosure('"'); // default: "
//	$csv->setEscape('\\'); // default: \\
//	$csv->setHeaders('name;number;price'); // default: null
$csv->setItemStart($start); // start item - default: 0
$csv->setExecute(10); // amount - default: 0
//	$csv->setTimeLimit(29); // Monitoring the execution time of the script in seconds set_time_limit
//	$csv->setAutoDetection(false); // Auto Detection Delimiter false|true - default: false

$stop = 500;

$records = $csv->Read();

$count = count($records);
	if ($count >= 1) {
		foreach ($records as $item) {

			print_r($item);
			print_r('');

		}
	}

$rows_total = $csv->countItems(); // returns total items
//	$csv->getHeaders(); // returns Array ( [0] => name [1] => number [2] => price )
//	$csv->getItemStart(); // returns string
//	$csv->getExecute(); // returns amount 10
$end = $csv->getItemEnd(); // returns 11
//	$csv->getAutoDetection(); // returns false|true
//	$csv->getCsvControl(); // returns Array ( [0] => ; [1] => " [2] => \ )

if ($filename && $end >= 0 && $rows_total >= 0) {

	if ($end = $stop || $end >= $rows_total) {
		print_r('');
		print_r('Memory, MB: '.$csv->getMemory());
		print_r('');
		print_r('Time, sec: '.$csv->getTime());
	}

}
```

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

License
-------

[](#license)

The MIT License (MIT). Please see [LICENSE](LICENSE) for more information.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3080d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/83c4d844db99c883895755ca0e1dab41ba50f6e9faedbb972c2d35230a7dc0c2?d=identicon)[joomimart](/maintainers/joomimart)

---

Top Contributors

[![ruslan-avantis](https://avatars.githubusercontent.com/u/16430046?v=4)](https://github.com/ruslan-avantis "ruslan-avantis (18 commits)")

---

Tags

csvcsv-readercsvreadparts

### Embed Badge

![Health badge](/badges/pllano-csv/health.svg)

```
[![Health](https://phpackages.com/badges/pllano-csv/health.svg)](https://phpackages.com/packages/pllano-csv)
```

###  Alternatives

[league/csv

CSV data manipulation made easy in PHP

3.5k166.1M646](/packages/league-csv)[openspout/openspout

PHP Library to read and write spreadsheet files (CSV, XLSX and ODS), in a fast and scalable way

1.1k57.6M131](/packages/openspout-openspout)[dcat/easy-excel

使用简单实用的语义化接口快速读写Excel文件

155373.4k24](/packages/dcat-easy-excel)[shuchkin/simplecsv

Parse and retrieve data from CSV files. Export data to CSV.

5192.4k](/packages/shuchkin-simplecsv)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
