{"id":20947534,"url":"https://github.com/kristijorgji/php-json-bender","last_synced_at":"2026-04-29T03:32:50.456Z","repository":{"id":57009284,"uuid":"144302498","full_name":"kristijorgji/php-json-bender","owner":"kristijorgji","description":"A simple library to convert json strings to php array declarations","archived":false,"fork":false,"pushed_at":"2018-08-10T15:28:56.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-20T16:04:49.504Z","etag":null,"topics":["code","declarations","generation","json","php","transformations"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/kristijorgji.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":"2018-08-10T15:20:28.000Z","updated_at":"2023-03-13T02:04:46.000Z","dependencies_parsed_at":"2022-08-21T14:50:50.807Z","dependency_job_id":null,"html_url":"https://github.com/kristijorgji/php-json-bender","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/kristijorgji/php-json-bender","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristijorgji%2Fphp-json-bender","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristijorgji%2Fphp-json-bender/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristijorgji%2Fphp-json-bender/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristijorgji%2Fphp-json-bender/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kristijorgji","download_url":"https://codeload.github.com/kristijorgji/php-json-bender/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristijorgji%2Fphp-json-bender/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32409128,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T02:37:21.628Z","status":"ssl_error","status_checked_at":"2026-04-29T02:36:50.947Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["code","declarations","generation","json","php","transformations"],"created_at":"2024-11-19T00:11:55.094Z","updated_at":"2026-04-29T03:32:50.437Z","avatar_url":"https://github.com/kristijorgji.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# php-json-bender\n\nSimple library to convert json strings to php array declarations.\n\n# Table of Contents\n\n- [Installation](#installation)\n- [Example](#Example)\n\n## Installation\n\n```sh\ncomposer require kristijorgji/php-json-bender\n```\n\n## Example\n\nRun in the console:\n```sh\nvendor/bin/phpJsonBender /srv/input/test.json /srv/output/test.php\n```\n\nFirst argument is the real path of the input json.\n\nSecond argument is the real path of the desired output.\n\nIn my example the content of the input file was as follows: \n```json\n[{\n  \"created_at\": \"Thu Jun 22 21:00:00 +0000 2017\",\n  \"id\": 877994604561387500,\n  \"id_str\": \"877994604561387520\",\n  \"text\": \"Creating a Grocery List Manager Using Angular, Part 1: Add \u0026amp; Display Items https://t.co/xFox78juL1 #Angular\",\n  \"truncated\": false,\n  \"entities\": {\n    \"hashtags\": [{\n      \"text\": \"Angular\",\n      \"indices\": [103, 111]\n    }],\n    \"symbols\": [],\n    \"user_mentions\": [],\n    \"urls\": [{\n      \"url\": \"https://t.co/xFox78juL1\",\n      \"expanded_url\": \"http://buff.ly/2sr60pf\",\n      \"display_url\": \"buff.ly/2sr60pf\",\n      \"indices\": [79, 102]\n    }]\n  },\n  \"source\": \"\u003ca href=\\\"http://bufferapp.com\\\" rel=\\\"nofollow\\\"\u003eBuffer\u003c/a\u003e\",\n  \"user\": {\n    \"id\": 772682964,\n    \"id_str\": \"772682964\",\n    \"name\": \"SitePoint JavaScript\",\n    \"screen_name\": \"SitePointJS\",\n    \"location\": \"Melbourne, Australia\",\n    \"description\": \"Keep up with JavaScript tutorials, tips, tricks and articles at SitePoint.\",\n    \"url\": \"http://t.co/cCH13gqeUK\",\n    \"entities\": {\n      \"url\": {\n        \"urls\": [{\n          \"url\": \"http://t.co/cCH13gqeUK\",\n          \"expanded_url\": \"http://sitepoint.com/javascript\",\n          \"display_url\": \"sitepoint.com/javascript\",\n          \"indices\": [0, 22]\n        }]\n      },\n      \"description\": {\n        \"urls\": []\n      }\n    },\n    \"protected\": false,\n    \"followers_count\": 2145,\n    \"friends_count\": 18,\n    \"listed_count\": 328,\n    \"created_at\": \"Wed Aug 22 02:06:33 +0000 2012\",\n    \"favourites_count\": 57,\n    \"utc_offset\": 43200,\n    \"time_zone\": \"Wellington\"\n  }\n}]\n```\n\nThe generated output php file at /srv/output/test.php is as follows:\n\n```php\n\u003c?php\n$array = [\n    '0' =\u003e [\n        'created_at' =\u003e 'Thu Jun 22 21:00:00 +0000 2017',\n        'id' =\u003e 877994604561387500,\n        'id_str' =\u003e '877994604561387520',\n        'text' =\u003e 'Creating a Grocery List Manager Using Angular, Part 1: Add \u0026amp; Display Items https://t.co/xFox78juL1 #Angular',\n        'truncated' =\u003e false,\n        'entities' =\u003e [\n            'hashtags' =\u003e [\n                '0' =\u003e [\n                    'text' =\u003e 'Angular',\n                    'indices' =\u003e [\n                        '0' =\u003e 103,\n                        '1' =\u003e 111,\n                    ],\n                ],\n            ],\n            'symbols' =\u003e [],\n            'user_mentions' =\u003e [],\n            'urls' =\u003e [\n                '0' =\u003e [\n                    'url' =\u003e 'https://t.co/xFox78juL1',\n                    'expanded_url' =\u003e 'http://buff.ly/2sr60pf',\n                    'display_url' =\u003e 'buff.ly/2sr60pf',\n                    'indices' =\u003e [\n                        '0' =\u003e 79,\n                        '1' =\u003e 102,\n                    ],\n                ],\n            ],\n        ],\n        'source' =\u003e '\u003ca href=\"http://bufferapp.com\" rel=\"nofollow\"\u003eBuffer\u003c/a\u003e',\n        'user' =\u003e [\n            'id' =\u003e 772682964,\n            'id_str' =\u003e '772682964',\n            'name' =\u003e 'SitePoint JavaScript',\n            'screen_name' =\u003e 'SitePointJS',\n            'location' =\u003e 'Melbourne, Australia',\n            'description' =\u003e 'Keep up with JavaScript tutorials, tips, tricks and articles at SitePoint.',\n            'url' =\u003e 'http://t.co/cCH13gqeUK',\n            'entities' =\u003e [\n                'url' =\u003e [\n                    'urls' =\u003e [\n                        '0' =\u003e [\n                            'url' =\u003e 'http://t.co/cCH13gqeUK',\n                            'expanded_url' =\u003e 'http://sitepoint.com/javascript',\n                            'display_url' =\u003e 'sitepoint.com/javascript',\n                            'indices' =\u003e [\n                                '0' =\u003e 0,\n                                '1' =\u003e 22,\n                            ],\n                        ],\n                    ],\n                ],\n                'description' =\u003e [\n                    'urls' =\u003e [],\n                ],\n            ],\n            'protected' =\u003e false,\n            'followers_count' =\u003e 2145,\n            'friends_count' =\u003e 18,\n            'listed_count' =\u003e 328,\n            'created_at' =\u003e 'Wed Aug 22 02:06:33 +0000 2012',\n            'favourites_count' =\u003e 57,\n            'utc_offset' =\u003e 43200,\n            'time_zone' =\u003e 'Wellington',\n        ],\n    ],\n];\n```\n\n## License\n\nphp-json-bender is released under the MIT Licence. See the bundled LICENSE file for details.\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkristijorgji%2Fphp-json-bender","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkristijorgji%2Fphp-json-bender","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkristijorgji%2Fphp-json-bender/lists"}