PHP Interface Webmozart\Json\Conversion\JsonConverter

Since: 1.3
Author: Bernhard Schussek ([email protected])
显示文件 Open project: webmozart/json Interface Usage Examples

Public Methods

Method Description
fromJson ( mixed $jsonData, array $options = [] ) : mixed Converts JSON to an implementation-specific data structure.
toJson ( mixed $data, array $options = [] ) : mixed Converts an implementation-specific data structure to JSON.

Method Details

fromJson() public method

Converts JSON to an implementation-specific data structure.
public fromJson ( mixed $jsonData, array $options = [] ) : mixed
$jsonData mixed The JSON data. Use a {@link JsonDecoder} to convert a JSON string to this data structure
$options array Additional implementation-specific conversion options
return mixed The converted data

toJson() public method

Converts an implementation-specific data structure to JSON.
public toJson ( mixed $data, array $options = [] ) : mixed
$data mixed The data to convert
$options array Additional implementation-specific conversion options
return mixed The JSON data. Pass this data to a {@link JsonEncoder} to generate a JSON string