{"id":15527533,"url":"https://github.com/elliotchance/phpserialize","last_synced_at":"2025-04-06T11:10:41.388Z","repository":{"id":22424689,"uuid":"96211206","full_name":"elliotchance/phpserialize","owner":"elliotchance","description":"📑 PHP serialize() and unserialize() for Go","archived":false,"fork":false,"pushed_at":"2024-01-31T15:17:15.000Z","size":62,"stargazers_count":126,"open_issues_count":9,"forks_count":40,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-30T09:09:51.993Z","etag":null,"topics":["encoding","go","php"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elliotchance.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-07-04T11:32:52.000Z","updated_at":"2025-03-04T15:45:53.000Z","dependencies_parsed_at":"2024-01-31T17:09:17.701Z","dependency_job_id":null,"html_url":"https://github.com/elliotchance/phpserialize","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotchance%2Fphpserialize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotchance%2Fphpserialize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotchance%2Fphpserialize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotchance%2Fphpserialize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elliotchance","download_url":"https://codeload.github.com/elliotchance/phpserialize/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247471521,"owners_count":20944158,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["encoding","go","php"],"created_at":"2024-10-02T11:06:57.290Z","updated_at":"2025-04-06T11:10:41.344Z","avatar_url":"https://github.com/elliotchance.png","language":"Go","readme":"[![Build Status](https://travis-ci.org/elliotchance/phpserialize.svg?branch=master)](https://travis-ci.org/elliotchance/phpserialize)\n\nPHP [serialize()](http://php.net/manual/en/function.serialize.php) and\n[unserialize()](http://php.net/manual/en/function.unserialize.php) for Go.\n\n# Install / Update\n\n```bash\ngo get -u github.com/elliotchance/phpserialize\n```\n\n`phpserialize` requires Go 1.8+.\n\n# Example\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/elliotchance/phpserialize\"\n)\n\nfunc main() {\n\tout, err := phpserialize.Marshal(3.2, nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(string(out))\n\n\tvar in float64\n\terr = phpserialize.Unmarshal(out, \u0026in)\n\n\tfmt.Println(in)\n}\n```\n\n### Using struct field tags for marshalling\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/elliotchance/phpserialize\"\n)\n\ntype MyStruct struct {\n\t// Will be marhsalled as my_purpose\n\tMyPurpose string `php:\"my_purpose\"`\n\t// Will be marshalled as my_motto, and only if not a nil pointer\n\tMyMotto *string `php:\"my_motto,omitnilptr\"`\n\t// Will not be marshalled\n\tMySecret string `php:\"-\"`\n}\n\nfunc main() {\n\tmy := MyStruct{\n\t\tMyPurpose: \"No purpose\",\n\t\tMySecret:  \"Has a purpose\",\n\t}\n\n\tout, err := phpserialize.Marshal(my, nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(out)\n}\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felliotchance%2Fphpserialize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felliotchance%2Fphpserialize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felliotchance%2Fphpserialize/lists"}