O
O
Orbitalis2017-04-22 20:20:08
PHP
Orbitalis, 2017-04-22 20:20:08

How to parse json with unescaped " in text?

Good afternoon.
One service issues json with unescaped " in the text via API
Here is an example

{
  "product": "Фритюрница "Philips" Comfort HD 6111",
  "version": 3.1,
  "releaseDate": "2014-06-25T00:00:00.000Z",
}

As you can see, in the first line there is " right in the text.
Because of this, json_decode dies when parsing.
What are the options to parse such json ?
Maybe you can somehow escape only " which are already in " " ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Orbitalis, 2017-04-22
@Orbitalis

This parser helped https://github.com/rgrove/jsmin-php
Thanks https://toster.ru/user/dpr for solving the issue )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question