swoft/serialize

simple data serializer tool library of the php

v2.0.1 2019-12-02 13:22 UTC

This package is auto-updated.

Last update: 2021-09-28 11:50:15 UTC


README

Latest Stable Version Php Version Library License Actions Status

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.