Download the PHP package panduanvip/ronolo-json-extract without Composer
On this page you can find all versions of the php package panduanvip/ronolo-json-extract. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download panduanvip/ronolo-json-extract
More information about panduanvip/ronolo-json-extract
Files in panduanvip/ronolo-json-extract
Package ronolo-json-extract
Short Description Extracts JSON from strings and returns PHP arrays.
License MIT
Homepage https://github.com/panduanvip/json-extract
Informations about the package ronolo-json-extract
Json Extractor Supports PHP 7.4
Abstract
Small class, which will try to extract JSON strings from a string. There are two functions which will achieve that.
Installation
Use
This will expect the identifier somewhere in the given string. The identifier position will act as starting point and the next valid JSON object or array will be returned as PHP array.
This will look for any JSON objects or arrays in the string and returns them as an array of arrays of JSON data. You may have to check the list of JSON data for data you was looking for.
It is recommend to break HTML down into smaller parts with a DOM parser, like symfony/dom-crawler or similar. The smaller the portion is which shall be parsed the better will be the result.
For example, if you parse a HTML string and expect the JSON inside the
... tags, feed only the text inside the tags to the json-extract functions. ## Can extract Correct JSON Incorrect Single-Quotes JSON Javascript Objects (Thanks to the CJSON.php) EOFAll versions of ronolo-json-extract with dependencies
ext-json Version *