内容简介:github地址:
Golang 实现 PHP 里的 serialize() 、 unserialize()
安装
go get -u github.com/techleeone/gophp/serialize
用法
package main import ( "fmt" "github.com/techleeone/gophp/serialize" ) func main() { str := `a:1:{s:3:"php";s:24:"世界上最好的语言";}` // unserialize() in php out, _ := serialize.UnMarshal([]byte(str)) fmt.Println(out) //map[php:世界上最好的语言] // serialize() in php jsonbyte, _ := serialize.Marshal(out) fmt.Println(string(jsonbyte)) // a:1:{s:3:"php";s:24:"世界上最好的语言";} }
github地址: https://github.com/techleeone...
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
猜你喜欢:- 序列化和反序列化的底层实现原理是什么?
- iOS 优雅地实现序列动画
- java序列化的内部实现(一)
- 详解动态规划最长公共子序列--JavaScript实现
- 序列帧&一镜到底H5开发实现分析
- Python实现JSON反序列化类对象
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Introduction to Algorithms, 3rd Edition
Thomas H. Cormen、Charles E. Leiserson、Ronald L. Rivest、Clifford Stein / The MIT Press / 2009-7-31 / USD 94.00
Some books on algorithms are rigorous but incomplete; others cover masses of material but lack rigor. Introduction to Algorithms uniquely combines rigor and comprehensiveness. The book covers a broad ......一起来看看 《Introduction to Algorithms, 3rd Edition》 这本书的介绍吧!