{"id":15735084,"url":"https://github.com/louislivi/json_encode","last_synced_at":"2026-05-10T06:55:51.350Z","repository":{"id":101493531,"uuid":"111632449","full_name":"louislivi/json_encode","owner":"louislivi","description":"php json_encode javascript version.","archived":false,"fork":false,"pushed_at":"2017-11-22T06:48:45.000Z","size":22,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-06T08:31:13.994Z","etag":null,"topics":["encode","javascript","json","jsonparse","php"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/louislivi.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-11-22T03:36:23.000Z","updated_at":"2020-09-21T06:08:15.000Z","dependencies_parsed_at":"2024-02-01T15:06:58.487Z","dependency_job_id":null,"html_url":"https://github.com/louislivi/json_encode","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louislivi%2Fjson_encode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louislivi%2Fjson_encode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louislivi%2Fjson_encode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louislivi%2Fjson_encode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/louislivi","download_url":"https://codeload.github.com/louislivi/json_encode/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246413243,"owners_count":20773053,"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":["encode","javascript","json","jsonparse","php"],"created_at":"2024-10-04T01:08:58.284Z","updated_at":"2026-05-10T06:55:46.288Z","avatar_url":"https://github.com/louislivi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# json_encode\n## php json_encode javascript version.\n\u003cp\u003ePHP json_encode javascript version.this file has php json_encode function ,and has php json_encode options constents\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003econst JSON_HEX_QUOT = 8;\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003econst JSON_HEX_TAG = 1;\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003econst JSON_HEX_AMP = 2;\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003econst JSON_HEX_APOS = 4;\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003econst JSON_NUMERIC_CHECK = 32;\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003econst JSON_UNESCAPED_SLASHES = 64;\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003econst JSON_UNESCAPED_UNICODE = 256;\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003econst JSON_FORCE_OBJECT = 16;\u003c/code\u003e\u003c/code\u003e\u003c/p\u003e\nalso chinese to unicode. example\n\u003cp\u003e中国  to \\u4e2d\\u56fd \u003c/p\u003e\n- Demo\n\u003cpre\u003e\u003ccode\u003e\n\u003cscript src=\"./json_encode.min.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  var arr = new Array;\n  arr['one'] = new Array;\n  arr['one'][0] = 0;\n  arr['one'][1] = 1;\n  arr['two'] = new Array;\n  arr['two']['one'] = 'one';\n  arr['two']['two'] = 'two';\n  arr['three'] = 3;\n  console.log(json_encode(arr));\n\u003c/script\u003e\n\u003c/code\u003e\u003c/pre\u003e\n\n* Result\n  \u003cpre\u003e\u003ccode\u003e{\"one\":[0,1],\"two\":{\"one\":\"one\",\"two\":\"two\"},\"three\":3}\u003c/code\u003e\u003c/pre\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flouislivi%2Fjson_encode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flouislivi%2Fjson_encode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flouislivi%2Fjson_encode/lists"}