PHP code example of idct / php-csv-writer

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

    

idct / php-csv-writer example snippets


use IDCT\CsvWriter\CsvWriter;
$csvWriter = new CsvWriter();

$csvWriter->open('filename.csv');

$csvWriter->openWithFieldsNames('filename.csv', ["columnA", "columnB", "columnC"]);

$csvWriter->open('filename.csv', CsvWriter::FILEMODE_APPEND);

$csvWriter->openWithFieldsNames('filename.csv', ["columnA", "columnB", "columnC"], CsvWriter::FILEMODE_APPEND);

$textWriter = new TextWriter();