PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Nahid Bin Azhar   PHP JSON Database Library   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP JSON Database Library
Perform queries on a JSON file database
Author: By
Last change:
Date: 3 years ago
Size: 447 bytes
 

Contents

Class file image Download
<?php
require_once 'jsonx.php';

$json=new JSONX('db/data.json');

//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')->fetch();

echo
$json->node('home:product:items')->where('id', '=', 2)->fetch();
//$json->node('product:items')->save($product);
//$json->node('product')->delete();
//echo $json->node('home:title')->fetch();