apidoc
[ class tree: apidoc ] [ index: apidoc ] [ all elements ]

Class: HTML_AJAX_JSON

Source Location: /HTML_AJAX-0.2.4/AJAX/JSON.php

Class Overview


HTML_AJAX_JSON Conversion to and from HTML_AJAX_JSON format.


Methods


Inherited Variables

Inherited Methods


Class Details

[line 38]
HTML_AJAX_JSON Conversion to and from HTML_AJAX_JSON format.

See http://json.org for details.

note all strings should be in ASCII or UTF-8 format!



[ Top ]


Method Detail

HTML_AJAX_JSON (Constructor)   [line 52]

HTML_AJAX_JSON HTML_AJAX_JSON( [use $use = HTML_AJAX_JSON_STRICT_TYPE])

function HTML_AJAX_JSON constructor

Parameters:

use   $use   — 

int object behavior: when encoding or decoding, be loose or strict about object/array usage

possible values: HTML_AJAX_JSON_STRICT_TYPE - strict typing, default "{...}" syntax creates objects in decode HTML_AJAX_JSON_LOOSE_TYPE - loose typing "{...}" syntax creates associative arrays in decode


[ Top ]

dec   [line 431]

void dec( $var)

function dec

alias for decode()


Parameters:

   $var   — 

[ Top ]

decode   [line 218]

mixed decode( str $str)

function decode decode a HTML_AJAX_JSON string into appropriate variable
  • Return: number, boolean, string, array, or object corresponding to given HTML_AJAX_JSON input string. see argument 1 to HTML_AJAX_JSON() above for object-output behavior. note that decode() always returns strings in ASCII or UTF-8 format!

Parameters:

str   $str   —  string HTML_AJAX_JSON-formatted string

[ Top ]

enc   [line 172]

void enc( $var)

function enc

alias for encode()


Parameters:

   $var   — 

[ Top ]

encode   [line 67]

string encode( var $var)

function encode encode an arbitrary variable into HTML_AJAX_JSON format
  • Return: HTML_AJAX_JSON string representation of input var

Parameters:

var   $var   —  mixed any number, boolean, string, array, or object to be encoded. see argument 1 to HTML_AJAX_JSON() above for array-parsing behavior. if var is a strng, note that encode() always expects it to be in ASCII or UTF-8 format!

[ Top ]

name_value   [line 185]

string name_value( name $name, value $value)

function name_value array-walking function for use in generating HTML_AJAX_JSON-formatted name-value pairs
  • Return: HTML_AJAX_JSON-formatted name-value pair, like '"name":value'

Parameters:

name   $name   —  string name of key to use
value   $value   —  mixed reference to an array element to be encoded

[ Top ]

reduce_string   [line 197]

string reduce_string( str $str)

function reduce_string reduce a string by removing leading and trailing comments and whitespace
  • Return: string value stripped of comments and whitespace

Parameters:

str   $str   —  string string value to strip of comments and whitespace

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:11:19 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.