PHP code example of syntaxsolutions / csvbuilder

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

    

syntaxsolutions / csvbuilder example snippets



// Load Composer's autoloader
e SyntaxSolutions\CsvRow;

$builder = new CsvBuilder();

$headers = new CsvRow();
$headers->addCell("Header 1");
$headers->addCell("Header 2");
$headers->addCell("Header 3");
$builder->addHeaders($headers);

$row = new CsvRow();
$row->addCell("Cell 1");
$row->addCell("Cell 2");
$row->addCell("Cell 3");
$builder->addRow($row);

echo $builder->getBytes();