soldierm/ndjson

php 解析 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

下载

composer require soldierm/ndjson

用法

解码 ndjson

<?php

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

编码 ndjson

<?php

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

表达你的支持

如果这个项目对你有帮助,请点个⭐️!

此 README 是由 readme-md-generator 使用❤️生成的