swiftmade/simple-serialize
Composer 安装命令:
composer require swiftmade/simple-serialize
包简介
Basic key:value; style serialization with string support only.
README 文档
README
This is a PHP package that serves a very simple purpose: Serialize associative string arrays.
Why?
We are using this package to turn some data into SMS messages and then convert SMS messages back to PHP arrays.
You can use it for any purpose you like, when json_encode or serialize is overkill.
Features
- Simple API:
simple_serialize($array)andsimple_unserialize($string) - Your keys or values can contain quotes, whitespaces, etc. No escaping needed.
- The only limitation is, your keys cannot contain colon (:) and your values cannot contain semi-colon (;)
- Tolerates syntax errors! It will still extract the valid bits of data.
Usage
Installation:
composer require swiftmade/simple-serialization
Serialize:
$array = ['your_key' => 'whatever information'];
$string = simple_serialize($array); // "your_key:whatever information"
Unserialize:
$string = "your_key:whatever information";
$array = simple_unserialize($string); // ['your_key' => 'whatever information'];
统计信息
- 总下载量: 85
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-11-10