PHP Class PhpBench\Json\JsonDecoder

Accepts non-strict "JSON": - {this: ["is": {where: "sparta"}]} # quoteless keys are allowed - this: ["is": {where: "sparta"}] # enclosing braces can be omitted Lints the JSON using the JsonParser.
Mostrar archivo Open project: dantleech/phpbench Class Usage Examples

Public Methods

Method Description
__construct ( )
decode ( string $jsonString ) : array Normalize, parse and decode the given JSON(ish) encoded string into an array.

Private Methods

Method Description
normalize ( $jsonString ) Allow "non-strict" JSON - i.e. if no quotes are provided then try and add them.

Method Details

__construct() public method

public __construct ( )

decode() public method

Normalize, parse and decode the given JSON(ish) encoded string into an array.
public decode ( string $jsonString ) : array
$jsonString string
return array