PHP code example of bera / csv

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

    

bera / csv example snippets




use Bera\Csv\Csv;

$csv = Csv::Init(__DIR__ , 'test.csv');
$csv->addHeader(array('a','b','c'));
$csv->addData(
    array(
        array(1,3,4),
        array(2,4,5),
        array(6,8,9),
    )
);
$csv->generate();