Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/php-toolkit/data-parser

simple data parser
https://github.com/php-toolkit/data-parser

Last synced: 7 days ago
JSON representation

simple data parser

Awesome Lists containing this project

README

        

# data parser utils

simple data parser for php

driver

- json(by `json_encode`)
- php(by `serialize`)
- swoole(by extension `swoole_serialize`)
- msgpack(by extension `msgpack`)

## Install

- composer command

```bash
composer require toolkit/data-parser
```

## Usage

```php
$parser = new SwooleParser();
// $parser = new JsonParser();
// $parser = new PhpParser();
// $parser = new MsgPackParser();

// encode
$encoded = $parser->encode($data);

// decode
$decoded = $parser->encode($encoded);
```

## Unit testing

```bash
phpunit
```

## License

MIT