PHP code example of averay / csv

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

    

averay / csv example snippets



use Averay\Csv\Reader;
use Averay\Csv\Schema\Types;

$reader = Reader::createFromPath('/path/to/csv');
$reader->setSchema([
  'id' => new Types\StringType(),
  'label' => new Types\StringType(nullable: true),
  'count' => new Types\IntType(),
]);