{"id":16474880,"url":"https://github.com/zegl/dson-php","last_synced_at":"2025-03-23T11:32:53.093Z","repository":{"id":17757983,"uuid":"20613213","full_name":"zegl/dson-php","owner":"zegl","description":"A DSON decoder / decoder in PHP","archived":false,"fork":false,"pushed_at":"2014-06-08T20:43:18.000Z","size":169,"stargazers_count":10,"open_issues_count":1,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-05-02T05:59:12.270Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://dogeon.org","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zegl.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}},"created_at":"2014-06-08T08:59:25.000Z","updated_at":"2022-07-05T22:40:18.000Z","dependencies_parsed_at":"2022-08-04T21:01:34.954Z","dependency_job_id":null,"html_url":"https://github.com/zegl/dson-php","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zegl%2Fdson-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zegl%2Fdson-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zegl%2Fdson-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zegl%2Fdson-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zegl","download_url":"https://codeload.github.com/zegl/dson-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245097158,"owners_count":20560311,"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":[],"created_at":"2024-10-11T12:34:44.991Z","updated_at":"2025-03-23T11:32:52.769Z","avatar_url":"https://github.com/zegl.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"dson-php\n======\n\nDSON encoder/decoder for PHP\n\n![Doge](http://dogeon.org/doge.gif)\n\n\n### What is dson-php?\n\ndson-php is a simple DSON \u003chttp://dogeon.org\u003e encoder\nand decoder. It is a pure PHP-implementatin without any special dependencies.\n\n### How to use?\n#### DSON::encode($in)\n\n```php\n$example = array(\n    \"many\" =\u003e \"wow\",\n    \"such\" =\u003e array(\"foo\", \"doge\", \"inu\")\n);\n\necho DSON::encode($example);\n```\n\n```\nsuch \"many\" is \"wow\" ! \"such\" is so \"foo\" and \"doge\" and \"inu\" many wow\n```\n\n#### DSON::decode($str, $assoc = false)\n```php\n$res = DSON::decode('such \"many\" is \"wow\" ! \"such\" is so \"foo\" and \"doge\" and \"inu\" many wow');\n```\n\n```\nobject(stdClass)#1 (2) {\n  [\"many\"]=\u003e\n  string(3) \"wow\"\n  [\"such\"]=\u003e\n  array(3) {\n    [0]=\u003e\n    string(3) \"foo\"\n    [1]=\u003e\n    string(4) \"doge\"\n    [2]=\u003e\n    string(3) \"inu\"\n  }\n}\n```\n\nSetting `$assoc = true` will generate the output as an associative array instead, (compare to \u003chttp://php.net/json_decode\u003e)\n\n```php\n$res = DSON::decode('such \"many\" is \"wow\" ! \"such\" is so \"foo\" and \"doge\" and \"inu\" many wow', true);\n```\n\n```\narray(2) {\n  [\"many\"]=\u003e\n  string(3) \"wow\"\n  [\"such\"]=\u003e\n  array(3) {\n    [0]=\u003e\n    string(3) \"foo\"\n    [1]=\u003e\n    string(4) \"doge\"\n    [2]=\u003e\n    string(3) \"inu\"\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzegl%2Fdson-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzegl%2Fdson-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzegl%2Fdson-php/lists"}