Encode PHP constructs to JSON

 Methods

Use the JSON encoding scheme for the value specified

encode(mixed $value, bool $cycleCheck, array $options) : string

Parameters

$value

mixed

The value to be encoded

$cycleCheck

bool

Whether or not to check for possible object recursion when encoding

$options

array

Additional options used during encoding

Returns

stringThe encoded value

Encodes the given $className into the class2 model of encoding PHP classes into JavaScript class2 classes.

encodeClass(\Zend\Json\$className $className, \Zend\Json\$package $package) : string

NOTE: Currently only public methods and variables are proxied onto the client machine

Parameters

$className

\Zend\Json\$className

string The name of the class, the class must be instantiable using a null constructor

$package

\Zend\Json\$package

string Optional package name appended to JavaScript proxy class name

Exceptions

\Zend\Json\Exception\InvalidArgumentException

Returns

stringThe class2 (JavaScript) encoding of the class

Encode several classes at once

encodeClasses(array $classNames, string $package) : string

Returns JSON encoded classes, using encodeClass().

Parameters

$classNames

array

$package

string

Returns

string

Encode Unicode Characters to \u0000 ASCII syntax.

encodeUnicodeString(string $value) : string

This algorithm was originally developed for the Solar Framework by Paul M. Jones

link http://solarphp.com/
link https://github.com/solarphp/core/blob/master/Solar/Json.php

Parameters

$value

string

Returns

string

 Properties