https://github.com/leeqvip/gophp
Golang implementation for PHP's functions
https://github.com/leeqvip/gophp
php serialize serializeforgo unserialize
Last synced: 4 months ago
JSON representation
Golang implementation for PHP's functions
- Host: GitHub
- URL: https://github.com/leeqvip/gophp
- Owner: leeqvip
- License: mit
- Created: 2025-03-07T06:01:33.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-11-27T11:07:23.000Z (over 1 year ago)
- Last Synced: 2025-03-14T13:09:43.131Z (over 1 year ago)
- Size: 17.6 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
Awesome Lists containing this project
README
gophp
====
[](https://travis-ci.com/leeqvip/gophp)
Golang implementation for PHP's functions
## Install / Update
```
go get -u github.com/leeqvip/gophp
```
## Example
```golang
package main
import (
"fmt"
"github.com/leeqvip/gophp"
)
func main() {
str := `a:1:{s:3:"php";s:24:"世界上最好的语言";}`
// unserialize() in php
out, _ := gophp.Unserialize([]byte(str))
fmt.Println(out) //map[php:世界上最好的语言]
// serialize() in php
jsonbyte, _ := gophp.Serialize(out)
fmt.Println(string(jsonbyte)) // a:1:{s:3:"php";s:24:"世界上最好的语言";}
}
```
## License
This project is licensed under the [MIT license](LICENSE).