syntaxsolutions / csvbuilder
A simple PHP library used to format data into comma-separated values (CSV)
1.01
2020-09-08 02:52 UTC
Requires
- php: >=7.0.0
This package is auto-updated.
Last update: 2025-04-21 11:18:35 UTC
README
A simple PHP library used to format data into comma-separated values (CSV).
Features
- RFC 4180 standard compliant
- UTF-8 encoded.
- Excel compatible.
Installation
composer require syntaxsolutions/csvbuilder
Example
<?php // Load Composer's autoloader require 'vendor/autoload.php'; use SyntaxSolutions\CsvBuilder; use 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();