soldierm/ndjson

php parse ndjson

1.0 2020-01-16 09:05 UTC

This package is auto-updated.

Last update: 2024-09-16 19:32:52 UTC


README

Version

Download

composer require soldierm/ndjson

Usage

Decode ndjson

<?php

$ndjson = <<<NDJSON
{"foo":"bar"}
{"hello":"world"}
NDJSON;
$decode = \Soldierm\Ndjson\Parser::decode($ndjson);

Encode ndjson

<?php

$array = [
    ['foo' => 'bar'],
    ['hello' => 'world']
];
$encode = \Soldierm\Ndjson\Parser::encode($array);

Show your support

Give a ⭐️ if this project helped you!

This README was generated with ❤️ by readme-md-generator