PHP code example of ignatenkovnikita / little-csv-helper

1. Go to this page and download the library: Download ignatenkovnikita/little-csv-helper library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ignatenkovnikita / little-csv-helper example snippets



class DbImporter extends AbstractImporter implements ImportInterface
{
    public function import($data, $params){
        // your logic hear
    }
}

$importer = new CsvImporter();
$importer->setData(new CsvReader([
    'filename' => $fileName,
        'fgetcsvOptions' => [
    //  'delimiter' => '\n'
    ],
    'startFromLine' => 1
    ]));
$importerClass = new DbImporter();
$r = $importer->import($importerClass, ['type' => $type]);
echo $r

php composer.phar