Skip to content

Commit 7d5e2d2

Browse files
committed
docs: add trailing comma support
1 parent b9e3201 commit 7d5e2d2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
- Lightweight JSON comment stripper library for PHP.
1212
- Makes possible to have comment in any form of JSON data.
1313
- Supported comments: single line `// comment` or multi line `/* comment */`.
14+
- Also strips trailing comma at the end of array or object, eg:
15+
- `[1,2,,]` => `[1,2]`
16+
- `{"x":1,,}` => `{"x":1}`
1417

1518
## Installation
1619
```bash
@@ -30,7 +33,7 @@ $someJsonText = '{"a":1,
3033
/* creepy comment*/"e":2.3,
3134
/* multi line
3235
comment */
33-
"f":"f1"}';
36+
"f":"f1",}';
3437

3538
// OR
3639
$someJsonText = file_get_contents('...');

0 commit comments

Comments
 (0)