swoft / serialize
simple data serializer tool library of the php
v2.0.1
2019-12-02 13:22 UTC
Requires
- php: >7.1.0
Requires (Dev)
- phpunit/phpunit: ^7.5
This package is auto-updated.
Last update: 2024-11-28 18:39:34 UTC
README
Universal data serializer for PHP
Serializers:
- json(by
json_encode
) - php(by
serialize
) - igbinary(by extension
igbinary
) - msgpack(by extension
msgpack
)
Install
- composer command
composer require swoft/serialize
Usage
$serializer = new JsonSerializer(); // $serializer = new PhpSerializer(); // $serializer = new IgBinarySerializer(); // $serializer = new MsgPackSerializer(); // serialize data $string = $serializer->serialize($data); // unserialize string $data = $serializer->unserialize($string);
Unit testing
phpunit
LICENSE
The Component is open-sourced software licensed under the Apache license.