Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

terremoth/php-dsv

Open more actions menu

Repository files navigation

PHP DSV Reader & Writer

Test Run Status License Latest Stable Version Total Downloads
codecov Test Coverage Psalm type coverage Psalm level Codacy Badge Maintainability

Inspired by: Why you should use and prefer DSV format instead of CSV

See demos/demo.php for examples.

Installation

composer require terremoth/php-dsv

Usage

require_once 'vendor/autoload.php';

use DSV\Writer;
use DSV\Reader;

$data = [
    ['Name', 'Comment'],
    ['Alice', 'She said, "Hello" and waved.'],
    ['Bob', 'This is a multi-line comment\r\nspanning two lines.'],
    ['Charlie', 'More fun with\ntwo lines.'],
    ['Diana', 'How about some UTF-8: café, naïve, résumé. 📝'],
    ['Edward', 'アップル'],
];

$writer = new Writer('demos/data.dsv');
$writer->write($data); // will write the $data to file in DSV format

$reader = new Reader('demos/data.dsv');
print_r($reader->read()); // will read the demos/data.dsv file and put it in array format 

About

DSV Reader and Writer implementation in PHP

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.