class JsonParser extends AbstractParser
JSON parser.
Converts data between associative array and JSON formats
Methods
string |
fromArray(array $array)
Converts data from an associative array to JSON. |
|
array |
toArray(string $data)
Converts data from JSON to an associative array. |
|
listFromArray($data) | from AbstractParser | |
listToArray($data) | from AbstractParser | |
string |
load(string $path)
Loads data from a file. |
from AbstractParser |
dump(string $data, string $path = null)
Dumps data to a file, or to STDOUT if no filename is given |
from AbstractParser | |
static AbstractParser |
getParser(string $type = 'XML')
Factory for getting an instance of a subclass of AbstractParser |
from AbstractParser |
string |
toJSON(array $array)
Alias for JsonParser::fromArray() |
|
array |
fromJSON(string $data)
Alias for JsonParser::toArray() |
Details
at line 26
public string
fromArray(array $array)
Converts data from an associative array to JSON.
at line 48
public array
toArray(string $data)
Converts data from JSON to an associative array.
in AbstractParser at line 43
public
listFromArray($data)
in AbstractParser at line 48
public
listToArray($data)
in AbstractParser at line 60
public string
load(string $path)
Loads data from a file.
Executes PHP code blocks in the file.
in AbstractParser at line 79
public
dump(string $data, string $path = null)
Dumps data to a file, or to STDOUT if no filename is given
in AbstractParser at line 95
static public AbstractParser
getParser(string $type = 'XML')
Factory for getting an instance of a subclass of AbstractParser
at line 37
public string
toJSON(array $array)
Alias for JsonParser::fromArray()
at line 59
public array
fromJSON(string $data)
Alias for JsonParser::toArray()