[ Index ]
 

Code source de DokuWiki 2006-11-06

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/inc/ -> JSON.php (sommaire)

Converts to and from JSON format. JSON (JavaScript Object Notation) 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.

Author: Michal Migurski <mike-json@teczno.com>
Author: Matt Knapp
Author: Brett Stimmerman
Copyright: 2005 Michal Migurski
License: http://www.freebsd.org/copyright/freebsd-license.html
Poids: 625 lignes (27 kb)
Inclus ou requis: 2 fois
Référencé: 0 fois
Nécessite: 1 fichier
 inc/utf8.php

Définit 1 class

JSON:: (7 méthodes):
  JSON()
  encode()
  enc()
  name_value()
  reduce_string()
  decode()
  dec()


Classe: JSON  - X-Ref

Converts to and from JSON format.

JSON($use=JSON_STRICT_TYPE)   X-Ref
constructs a new JSON instance

param: int     $use    object behavior: when encoding or decoding,

encode($var)   X-Ref
encodes an arbitrary variable into JSON format

param: mixed   $var    any number, boolean, string, array, or object to be encoded.
return: string  JSON string representation of input var

enc($var)   X-Ref
encodes an arbitrary variable into JSON format, alias for encode()


name_value($name, $value)   X-Ref
Pas de description

reduce_string($str)   X-Ref
reduce a string by removing leading and trailing comments and whitespace

param: $str    string      string value to strip of comments and whitespace
return: string  string value stripped of comments and whitespace

decode($str)   X-Ref
decodes a JSON string into appropriate variable

param: string  $str    JSON-formatted string
return: mixed   number, boolean, string, array, or object

dec($var)   X-Ref
decodes a JSON string into appropriate variable; alias for decode()




Généré le : Tue Apr 3 20:47:31 2007 par Balluche grâce à PHPXref 0.7