Recommend this page to a friend! |
Download |
Info | Example | Files | Install with Composer | Download | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2024-11-02 (Yesterday) | Not enough user ratings | Total: 19 This week: 3 | All time: 11,325 This week: 12 |
Version | License | PHP version | Categories | |||
heavyjsondecode 1.0 | MIT/X Consortium ... | 5 | PHP 5, Data types, Parsers |
Description | Author | |
This class can parse and decode JSON data from a file or string. |
PHP JSON Decode large data with lesser resources
<?php
require "JsonDecode.php";
// Creating json file handle
$fp = fopen('/usr/local/var/www/rnd/test.json', 'rb');
// Create JsonEncode Object.
$JsonDecode = new JsonDecode($fp);
$JsonDecode->init();
// Validate JSON
$JsonDecode->validate();
$jsonDecode = null;
<?php
require "JsonDecode.php";
// Creating json file handle
$fp = fopen('/usr/local/var/www/rnd/test.json', 'rb');
// Create JsonEncode Object.
$JsonDecode = new JsonDecode($fp);
$JsonDecode->init();
// Indexing JSON
$JsonDecode->indexJson();
// Transverse across key 'data'
if ($JsonDecode->isset('data') && $JsonDecode->jsonType('data') === 'Array') {
for ($i=0, $i_count = $JsonDecode->count('data'); $i < $i_count; $i++) {
$key = "data:{$i}";
// Row details without Sub arrays
$row = $JsonDecode->get($key);
print_r($row);
// Row with Sub arrays / Complete $key array recursively.
$completeRow = $JsonDecode->getCompleteArray($key);
print_r($completeRow);
}
}
$jsonDecode = null;
Files (3) |
File | Role | Description |
---|---|---|
JsonDecode.php | Class | Heavy Json Decode |
LICENSE | Lic. | License text |
README.md | Example | Example script |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.