Zend\Json\Json
Class for encoding to and decoding from JSON.
Synopsis
class Json
{
- // constants
- const TYPE_ARRAY = 1;
- const TYPE_OBJECT = 0;
- // members
- public integer $maxRecursionDepthAllowed;
- public bool $useBuiltinEncoderDecoder;
- // methods
- public static mixed decode()
- public static string encode()
- protected static mixed _recursiveJsonExprFinder()
- protected static Expr|string _getXmlValue()
- protected static array _processXml()
- public static mixed fromXml()
- public static string prettyPrint()
Tasks
Line | Task |
---|---|
166 | Optimize with ascii keys, if performance is bad |
Constants
Name | Value |
---|---|
TYPE_ARRAY | 1 |
TYPE_OBJECT | 0 |
Members
public
- $maxRecursionDepthAllowed
—
int
To check the allowed nesting depth of the XML tree during xml2json conversion. - $useBuiltinEncoderDecoder — Zend\Json\bool
Methods
protected
- _getXmlValue() — Return the value of an XML attribute text or the text between the XML tags
- _processXml() — _processXml - Contains the logic for xml2json
- _recursiveJsonExprFinder() — Check & Replace Zend\Json\Expr for tmp ids in the valueToEncode
public
- decode() — Decodes the given $encodedValue string which is encoded in the JSON format
- encode() — Encode the mixed $valueToEncode into the JSON format
- fromXml() — fromXml - Converts XML to JSON
- prettyPrint() — Pretty-print JSON string