Services_JSON
pear.php.net
PHP implementaion of json_encode/decode
JSON (JavaScript Object Notation, http://json.org) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language, Standard ECMA-262 3rd Edition - December 1999. This feature can also be found in Python. JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, TCL, and many others. These properties make JSON an ideal data-interchange language.

This package provides a simple encoder and decoder for JSON notation. It is intended for use with client-side Javascript applications that make use of HTTPRequest to perform server communication functions - data can be encoded into JSON notation for use in a client-side javascript, or decoded from incoming Javascript requests. JSON format is native to Javascript, and can be directly eval()'ed with no further parsing overhead.
Michal Migurski
migurski
migurski@php.net yes
Alan Knowles
alan_k
alan@akbkhome.com yes
2011-01-14
10:40:48
1.0.3
1.0.0
stable
stable
BSD
Minor feature / bugfix release

#18018 - toJSON() support (classes can now implement toJSON(), which should return #17921 - long strings cause problems for parser #17515 - handle mbstring overloading of strlen ------ - cache lookups for mb functions during constructor

toJSON notes: $ser = new Services_JSON( SERVICES_JSON_USE_TO_JSON );

class A { // toJSON should return an associtive array of the properties to serialize // same standard as JSON.stringify() function toJSON() { return array( 'a' => $this->a, 'b'=>$this->b) ; } } echo $sj->encode(new A());
4.3
1.4.0b1
2009-01-02
1.0.2
1.0.0
stable
stable
BSD
Fixed Bug #16908 - When locale was set, and it changed the way numbers are formated, the output for floats was broken
2009-05-23
1.0.1
1.0.0
stable
stable
BSD
Fixed Bug #16585 - Fix correct mime type for encode() - note use encodeUnsafe() to prevent headers being sent.
2009-05-23
1.0.0
1.0.0
stable
stable
BSD
Fixed Bug #16251 - Back out change - Use double quotes as per spec
2009-03-13
0.9.0
0.9.0
beta
beta
BSD
Released into pear with minor changes to original proposal - encode() - encodes and adds http headers - encodeUnsafe() - encodes only - Some UTF8 fixes (better handling of invalid characters)