php-extended / php-data-provider-csv
An implementation of php-extended/php-data-provider-interface that interprets csv data
5.0.0
2022-12-17 22:12 UTC
Requires
- php: >=7.3
- php-extended/php-data-provider-interface: ^5
- php-extended/polyfill-php80-stringable: ^1.2
Requires (Dev)
This package is auto-updated.
Last update: 2023-05-17 23:12:58 UTC
README
An implementation of php-extended/php-data-provider-csv that interprets csv data.
Installation
The installation of this library is made via composer and the autoloading of all classes of this library is made through their autoloader.
- Download
composer.phar
from their website. - Then run the following command to install this library as dependency :
php composer.phar php-extended/php-data-provider-csv": "^5"
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).