library json-extractor
Library for extracting JSON from a string or DomDocument object
c2is/json-extractor
Library for extracting JSON from a string or DomDocument object
- Friday, April 15, 2016
- by gmanen
- Repository
- 25 Watchers
- 1 Stars
- 1,437 Installations
- PHP
- 1 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 3 Versions
- 8 % Grown
This library allows you to extract Json from a string/json/array using JsonPath., (*1)
JSONPath Examples
JSONPath |
Result |
$.store.books[\*].author |
the authors of all books in the store |
$..author |
all authors |
$.store..price |
the price of everything in the store. |
$..books[2] |
the third book |
$..books[(@.length-1)] |
the last book in order. |
$..books[0,1] |
the first two books |
$..books[:2] |
the first two books |
$..books[?(@.isbn)] |
filter all books with isbn number |
$..books[?(@.price<10)] |
filter all books cheapier than 10 |
$..* |
all elements in the data (recursively extracted) |
Expression syntax
Symbol |
Description |
$ |
The root object/element (not strictly necessary) |
@ |
The current object/element |
. or []
|
Child operator |
.. |
Recursive descent |
* |
Wildcard. All child elements regardless their index. |
[,] |
Array indices as a set |
[start:end:step] |
Array slice operator borrowed from ES4/Python. |
?() |
Filters a result set by a script expression |
() |
Uses the result of a script expression as the index |
dev-master
9999999-dev
http://github.com/
Library for extracting JSON from a string or DomDocument object
Sources
Download
GPL-3.0+
The Requires
by
John Daligault
parser
json
extract
v1.0.1
1.0.1.0
http://github.com/
Library for extracting JSON from a string or DomDocument object
Sources
Download
GPL-3.0+
The Requires
by
John Daligault
parser
json
extract
v1.0
1.0.0.0
http://github.com/
Library for extracting JSON from a string or DomDocument object
Sources
Download
GPL-3.0+
The Requires
by
John Daligault
parser
json
extract