midnite81 / json-parser
A PHP JSON parser with Error Control
Installs: 10 168
Dependents: 2
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- ext-json: *
Requires (Dev)
- phpunit/phpunit: ^5.7
- satooshi/php-coveralls: 1.0.*
This package is auto-updated.
Last update: 2024-09-16 07:54:01 UTC
README
This package allows for Error Handling while encoding and decoding JSON.
To install through composer include the package in your composer.json
.
"midnite81/json-parser": "^1.0.0"
Run composer install
or composer update
to download the dependencies or you can run composer require midnite81/json-parser
.
Example usage
use Midnite81\JsonParser\JsonParse;
public function returnData()
{
// your encoded data
$myData = '{"message":"Hello World"}';
try {
JsonParse::decode($myData);
} catch (JsonException $e) {
die('Something went wrong: ' . $e->getMessage());
}
}