PHP code example of egyg33k / csv-bundle

1. Go to this page and download the library: Download egyg33k/csv-bundle 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/ */

    

egyg33k / csv-bundle example snippets

 php
# Reader
$reader = $this->container->get('egyg33k.csv.reader');
$csv = $reader::createFromPath('/home/egyg33k/Desktop/org.csv');
var_dump($csv->fetchOne());
#Writer
$writer = $this->container->get('egyg33k.csv.writer');
$csv = $writer::createFromFileObject(new \SplTempFileObject());
$csv->insertOne(['firstname', 'lastname', 'email']);
$csv->output('users.csv');