PHP code example of simpl / csv

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

    

simpl / csv example snippets



use Simpl\Csv\Reader;
$csv = Reader::createFromFile('/path/to/your/file.csv');
$csv->setColumns(['name', 'address', 'phone']);
$csv->setSkipRows(1);

while($row = $csv->read())
{
    print_r($row['address']);
}