Skip to content

Latest commit

History

53 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

PHP JSON Handler

Class to open, modify and write json objects in files.

Installation (without composer)

Just include the json.php file.

require'src/json.php';

Alternatively, namespace and autoload it.

Installation (with composer)

composer require dayjo/php-json-handler

Then use;

useDayjo\JSON;

Usage

Basic usage includes auto saving, so you just modify the data and it saves!

<?php$JSON = newJSON('config.json');
$config =& $JSON->data; // You could just do $config->data->name = ...$config->name = 'dayjo';
$config->last_edited = time();

Options

Auto Save

The optional second parameter to the JSON class allows you to turn off auto save, and make it so you have to run the save function manually for instance;

<?php$JSON = newJSON('config.json', false);
$config =& $JSON->data;
$config->name = 'dayjo';
$JSON->save();

About

Class to open, modify and write json objects in files

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages