PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
  Classes of Nahid Bin Azhar  >  PHP JSON DB Library  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP JSON DB Library
Manage a database with data stored in JSON files
Author: By
Last change:
Date: 4 months ago
Size: 268 bytes
 

 

Contents

Class file image Download
<?php
require_once 'jsondb.php';
use
Nahid\JsonDb;
$json=new JsonDb('erp');

//to save data in data.json file

$product=[
  [
'id'=>1, 'name'=>'Nokia'],
  [
'id'=>2, 'name'=>'iPhone'],
  [
'id'=>3, 'name'=>'Samsung']
];

echo
$json->node('home:title')->save($product);