antonischas/turbo_csv

Array to CSV and general CSV functionality

Maintainers

Package info

github.com/antonischas/turbocsv

pkg:composer/antonischas/turbo_csv

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

dev-master 2020-01-20 09:16 UTC

This package is auto-updated.

Last update: 2026-02-20 23:51:03 UTC


README

by antonischas

Description

An easy to use array to CSV library.

Example array to CSV:

$data = [
            'names' => ['Antonis', 'Giannis', 'Teo'],
            'ages'  => [21,24,43]
        ];
        
$options = [
            'delimiter' => ';',
            'new_line' => "\n",
            'enclosure' => '"',
            'escape_char' => "\\",
            'use_headers' => true
        ];
        
$csv = new Csv();

$csv_content = $csv->create($data, $options);

Example CSV file to array:

        
$csv = new Csv();

$csv_array = $csv->fileToArray('test.csv', ['delimiter' => ';']

Versions

  • 1.2
    • Add associative array from headers support.
  • 1.1
    • Add CSV file to array conversion.
  • 1.0
    • Simple array to CSV conversion.

License

GNU GPL v3.0

You are welcome 👍