Utility/JsonValidator.php
- Package
- Default
\JsonValidator
Package: Default
Methods

validate( $string, boolean $throwException = true) : booleanstatic
Validate if a given string is a non-emtpy JSON format so we can convert it to an object array
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $string | ||
| $throwException | boolean | flag : true throw an exception if the string is invalid JSON, false omit the exception |
| Type | Description |
|---|---|
| boolean | True if the string is a valid JSON; false otherwise |