php-extended/php-data-provider-csv

An implementation of php-extended/php-data-provider-interface that interprets csv data

4.0.1 2022-06-06 16:43 UTC

README

An implementation of php-extended/php-data-provider-csv that interprets csv data.

coverage build status

Installation

The installation of this library is made via composer. Download composer.phar from their website. Then add to your composer.json :

	"require": {
		...
		"php-extended/php-data-provider-csv": "^4"
		...
	}

Then run php composer.phar update to install this library. The autoloading of all classes of this library is made through composer's autoloader.

Basic Usage

You may use this library the following way :


use PhpExtended\DataProvider\CsvFileDataProvider;

$provider = new CsvFileDataProvider('/path/to/csv.file', true);

foreach($provider->provideIterator() as $line => $data)
{
	// do something
}

You may also use an in-memory data provider with a string as raw csv data using the PhpExtended\DataProvider\CsvStringDataProvider.

License

MIT (See license file).