Skip to content

This library is an object-oriented interface that works with data in JSON format

License

Notifications You must be signed in to change notification settings

SteeinRu/json-data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SteeinJSON Data

This library is an object-oriented interface that works with data in JSON format

Usage

Example 1

use SteeinJSON\JSON;

$myJson = "
{
  "steein":
  {
    "item":"value"
  }
}
";
$object = new JSON($myJson);

Example 2

use 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 objects

If you would like to work with an existing object, rather than parsing a string, pass this object as the third constructor argument:

use SteeinJSON\JSON;

$object = new JSON(null, null, $customJSON);



///Validating Against a Schema
$object->check($customSchema, [$extraSchemaURI => $extraSchemaData]);

Author: Shamsudin Serderov

About

This library is an object-oriented interface that works with data in JSON format

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages