You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
echo "All books where ISBN ends with 1, 2 or 3:\n" . json_encode($result, JSON_PRETTY_PRINT) . "\n";
134
93
```
135
94
The above example will output:
136
95
```
137
-
138
-
Get authors of all books in the store:
96
+
Authors of all books in the store:
139
97
[
140
98
"Nigel Rees",
141
99
"Evelyn Waugh",
142
100
"Herman Melville",
143
101
"J. R. R. Tolkien"
144
102
]
145
-
Get the prices of everything in the store:
103
+
Prices of everything in the store:
146
104
[
147
105
8.95,
148
106
12.99,
149
107
8.99,
150
108
22.99,
151
109
399
152
110
]
153
-
Get the last book in order:
111
+
Last book in order:
154
112
[
155
113
{
156
114
"category": "fiction",
@@ -160,7 +118,7 @@ Get the last book in order:
160
118
"price": 22.99
161
119
}
162
120
]
163
-
Get the first two books with union operator:
121
+
First two books with union operator:
164
122
[
165
123
{
166
124
"category": "reference",
@@ -175,7 +133,7 @@ Get the first two books with union operator:
175
133
"price": 12.99
176
134
}
177
135
]
178
-
Get the first two books with array slice operator:
136
+
First two books with array slice operator:
179
137
[
180
138
{
181
139
"category": "reference",
@@ -190,7 +148,7 @@ Get the first two books with array slice operator:
190
148
"price": 12.99
191
149
}
192
150
]
193
-
Get all books with an ISBN number:
151
+
All books with an ISBN number:
194
152
[
195
153
{
196
154
"category": "fiction",
@@ -207,7 +165,7 @@ Get all books with an ISBN number:
207
165
"price": 22.99
208
166
}
209
167
]
210
-
Get all books cheaper than 10:
168
+
All books cheaper than 10:
211
169
[
212
170
{
213
171
"category": "reference",
@@ -223,7 +181,7 @@ Get all books cheaper than 10:
223
181
"price": 8.99
224
182
}
225
183
]
226
-
Get all books where ISBN ends with 1, 2 or 3 (Regular Expression):
184
+
All books where ISBN ends with 1, 2 or 3:
227
185
[
228
186
{
229
187
"category": "fiction",
@@ -233,14 +191,12 @@ Get all books where ISBN ends with 1, 2 or 3 (Regular Expression):
233
191
"price": 8.99
234
192
}
235
193
]
236
-
237
194
```
238
195
239
196
### Get paths
240
197
The following example shows how to get value paths that match a JSONPath, where each value path is represented as normalized JSONPath according to section 2.7 of [JSONPath internet draft](https://datatracker.ietf.org/doc/draft-ietf-jsonpath-base/21/).\
241
198
The result is always an array of matched paths. If there are no matches, an empty array is returned.
echo "Deleted all $numDeleted books that are more expensive than 9:\n" . json_encode($data, JSON_PRETTY_PRINT) . "\n";
553
464
```
554
465
The above example will output:
555
466
```
556
-
Delete all books that are more expensive than 9 euros:
467
+
Deleted all 2 books in store that are more expensive than 9:
557
468
{
558
469
"store": {
559
470
"book": {
@@ -577,7 +488,6 @@ Delete all books that are more expensive than 9 euros:
577
488
}
578
489
}
579
490
}
580
-
581
491
```
582
492
### Custom function extensions
583
493
The following example shows how to register custom function extensions according to section 2.4 of [JSONPath internet draft](https://datatracker.ietf.org/doc/draft-ietf-jsonpath-base/21/).
0 commit comments