baolq2020/rdcsv

Read data from csv file

Installs: 2

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/baolq2020/rdcsv

dev-master 2020-03-13 03:58 UTC

This package is auto-updated.

Last update: 2025-09-13 16:16:47 UTC


README

Setup:

composer require baolq2020/rdcsv:dev-master

Example:

We have 2 way for using this library:

#You can use function for convert csv to array.

Full option
$Iacsv = Iacsv::start('path file')
	->setRowStart(2) // This is option( Default 0 )
	->setIsUTF8(true) // This is option( Will be auto detect if you don't set )
	->setDelimiter(';') // This is option( Will be auto detect if you don't set )
	->all();
	
Short way with auto detect (slow performance)
$Iacsv = Iacsv::start('path file')->all();

#You can loop csv file and get single row content for improve performance

$Iacsv = new Iacsv($pathFile);
$Iacsv->setRowStart(11); // This is option( Default 0 )
$Iacsv->setIsUTF8(true); // This is option( Will be auto detect if you don't set )
$Iacsv->setDelimiter(';'); // This is option( Will be auto detect if you don't set )
$Iacsv->openSingleRow();
while ($Iacsv->checkIsNotEof()) {
	$singleRow = $Iacsv->getSingleRow(); // You can get your single row data here.
	print_r($singleRow);
}