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

https://github.com/swoft-cloud/swoft-data-parser

Data parser of swoft 1.0(Now 2.0, please use swoft/swoft-serialize)
https://github.com/swoft-cloud/swoft-data-parser

php swoft

Last synced: 8 months ago
JSON representation

Data parser of swoft 1.0(Now 2.0, please use swoft/swoft-serialize)

Awesome Lists containing this project

README

          

# Data parser

Universal data parser/ for PHP

Driver:

- json(by `json_encode`)
- php(by `serialize`)
- igbinary(by extension `igbinary`)
- msgpack(by extension `msgpack`)

## Install

- composer command

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

## Usage

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

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

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

## Unit testing

```bash
phpunit
```

## LICENSE

The Component is open-sourced software licensed under the [Apache license](LICENSE).