Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/louislivi/json_encode
php json_encode javascript version.
https://github.com/louislivi/json_encode
encode javascript json jsonparse php
Last synced: 11 days ago
JSON representation
php json_encode javascript version.
- Host: GitHub
- URL: https://github.com/louislivi/json_encode
- Owner: louislivi
- License: apache-2.0
- Created: 2017-11-22T03:36:23.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-22T06:48:45.000Z (almost 7 years ago)
- Last Synced: 2024-10-11T01:09:13.233Z (25 days ago)
- Topics: encode, javascript, json, jsonparse, php
- Language: JavaScript
- Size: 21.5 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# json_encode
## php json_encode javascript version.PHP json_encode javascript version.this file has php json_encode function ,and has php json_encode options constents
const JSON_HEX_QUOT = 8;
const JSON_HEX_TAG = 1;
const JSON_HEX_AMP = 2;
const JSON_HEX_APOS = 4;
const JSON_NUMERIC_CHECK = 32;
const JSON_UNESCAPED_SLASHES = 64;
const JSON_UNESCAPED_UNICODE = 256;
const JSON_FORCE_OBJECT = 16;
also chinese to unicode. example中国 to \u4e2d\u56fd
- Demo
var arr = new Array;
arr['one'] = new Array;
arr['one'][0] = 0;
arr['one'][1] = 1;
arr['two'] = new Array;
arr['two']['one'] = 'one';
arr['two']['two'] = 'two';
arr['three'] = 3;
console.log(json_encode(arr));* Result
{"one":[0,1],"two":{"one":"one","two":"two"},"three":3}