PHP code example of quorum / exporter

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

    

quorum / exporter example snippets




use Quorum\Exporter\DataExport;
use Quorum\Exporter\DataSheet;
use Quorum\Exporter\Engines\CsvEngine;

csv->setMultiSheetStrategy(CsvEngine::STRATEGY_ZIP);

$sheetA = new DataSheet('a');
$sheetB = new DataSheet('b');

$exporter->addSheet($sheetA);
$exporter->addSheet($sheetB);

// Add a single row at a time;
$sheetA->addRow([ 1, 2, 3 ]);
$sheetA->addRow([ "a", "b", "c" ]);

// Add Multiple Rows
$sheetB->addRows([
	[ 4, 5, 6 ],
	[ 7, 8, 9 ],
]);

$exporter->export();


function __construct(\Quorum\Exporter\EngineInterface $engine)

function addSheet(\Quorum\Exporter\DataSheet $sheet [, ?string $sheetTitle = null]) : void

function export([ $outputStream = null]) : void

function __construct([ ?string $name = null])

function getName() : ?string

function addRow(array $row) : void

function addRows($dataSet) : void

function current() : ?array

function next() : void

function key() : int

function valid() : bool

function rewind() : void


namespace Quorum\Exporter\Engines;

class CsvEngine {
	public const STRATEGY_CONCAT = 'stat-concat';
	public const STRATEGY_ZIP = 'stat-zip';
	public const UTF8 = 'UTF-8';
	public const UTF16 = 'UTF-16';
	public const UTF16BE = 'UTF-16BE';
	public const UTF16LE = 'UTF-16LE';
	public const UTF32 = 'UTF-32';
	public const UTF32BE = 'UTF-32BE';
	public const UTF32LE = 'UTF-32LE';
}

function __construct([ string $outputEncoding = self::UTF16LE [, ?string $delimiter = null [, string $enclosure = '"' [, string $inputEncoding = self::UTF8]]]])

function setEnclosure(string $enclosure) : void

function setTmpDir(string $tmpDir) : void

function getMultiSheetStrategy() : string

function setMultiSheetStrategy(string $multiSheetStrategy) : void

function getDelimiter() : string

function setDelimiter(?string $delimiter) : void

function getEnclosure() : string

function disableBom([ bool $disable = true]) : void

function setCreatedTime(?int $createdTime) : void