/phpserialize

📑 PHP serialize() and unserialize() for Go

Primary LanguageGoMIT LicenseMIT

Build Status

PHP serialize() and unserialize() for Go.

Install / Update

go get -u github.com/elliotchance/phpserialize

phpserialize requires Go 1.8+.

Example

package main

import (
	"github.com/elliotchance/phpserialize"
	"fmt"
)

func main() {
	out, err := phpserialize.Marshal(3.2, nil)
	if err != nil {
		panic(err)
	}

	fmt.Println(string(out))

	var in float64
	err = phpserialize.Unmarshal(out, &in)

	fmt.Println(in)
}