https://github.com/steeinru/json-data
This library is an object-oriented interface that works with data in JSON format
https://github.com/steeinru/json-data
json json-format json-objects oriented-interface php-7
Last synced: 3 months ago
JSON representation
This library is an object-oriented interface that works with data in JSON format
- Host: GitHub
- URL: https://github.com/steeinru/json-data
- Owner: SteeinRu
- License: mit
- Created: 2017-01-18T15:37:52.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-01-22T00:43:42.000Z (over 8 years ago)
- Last Synced: 2025-01-19T18:43:59.696Z (5 months ago)
- Topics: json, json-format, json-objects, oriented-interface, php-7
- Language: PHP
- Homepage:
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## SteeinJSON Data
This library is an object-oriented interface that works with data in JSON format
### Usage
#### Example 1
```php
use SteeinJSON\JSON;
$myJson = "
{
"steein":
{
"item":"value"
}
}
";
$object = new JSON($myJson);
```#### Example 2
```phpuse SteeinJSON\JSON;
$object = new JSON();
$object->text->item = 'value';
$object->text->item->one = 'value2';//By default, simply output through "echo"
echo $object;//At the request is allowed to maintain in a JSON file
$file = __DIR__.'/json/item.json';
$object->save($file);```
### Working with existing objectsIf you would like to work with an existing object, rather than parsing a string, pass this object as the third constructor argument:
```php
use SteeinJSON\JSON;$object = new JSON(null, null, $customJSON);
///Validating Against a Schema
$object->check($customSchema, [$extraSchemaURI => $extraSchemaData]);```
#### Author: Shamsudin Serderov