Skip to content

Instantly share code, notes, and snippets.

@elliotchance
Last active November 14, 2018 21:13
Show Gist options
  • Select an option

  • Save elliotchance/2a55d0ff74172177469e9c4d5f38187b to your computer and use it in GitHub Desktop.

Select an option

Save elliotchance/2a55d0ff74172177469e9c4d5f38187b to your computer and use it in GitHub Desktop.
{
"foo": "bar",
"baz": 123
}
O:8:"stdClass":2:{s:3:"foo";s:3:"bar";s:3:"baz";i:123;}
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)
}
go get -u github.com/elliotchance/phpserialize
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment