Skip to content

Commit

Permalink
update license
Browse files Browse the repository at this point in the history
  • Loading branch information
nahid committed May 5, 2018
1 parent 5481190 commit 0bb56cd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"keywords": ["json", "jsonq", "query"],
"homepage": "https://github.com/nahid/jsonq",
"type": "library",
"license": "Creative Commons",
"license": "CC-BY-3.0",
"authors": [
{
"name": "Nahid Bin Azhar",
Expand Down
3 changes: 2 additions & 1 deletion data.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
{"id":2, "name":"macbook pro", "cat": 2, "price": 150000},
{"id":3, "name":"Redmi 3S Prime", "cat": 1, "price": 12000},
{"id":4, "name":"Redmi 4X", "cat":1, "price": 15000},
{"id":5, "name":"macbook air", "cat": 2, "price": 110000}
{"id":5, "name":"macbook air", "cat": 2, "price": 110000},
{"id":6, "name":"macbook air", "cat": 2, "price": 81000}
]
}
15 changes: 5 additions & 10 deletions example/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,11 @@
$json->import('../data.json');


$result = $json
->from('users')
//->where('id', '=', 6)
//->then('visits')
//->where('year', '=', 2011)
->fetch()
->each(function($key, $val) {
echo $key . ' = ' .$val['name'] . '<br/>';
});

$result = $json->from('products')
->where('cat', '=', 1)
->fetch()
->sortAs('price', 'desc')
->first();


echo '<pre>';
Expand Down

0 comments on commit 0bb56cd

Please sign in to comment.