Example #1
0
function globalSchemas($gid)
{
    if ($gid == 440 && !isset($GLOBALS['schemas_440'])) {
        $GLOBALS['schemas_440'] = array('schema' => localSchema(), 'prices' => localPriceList(), 'est' => local_global_whitelist());
    }
    if ($gid == 730 && !isset($GLOBALS['schemas_730'])) {
        $GLOBALS['schemas_730'] = schema_730();
    }
    if ($gid == 570 && !isset($GLOBALS['schemas_570'])) {
        $GLOBALS['schemas_570']['schema'] = schema_570();
    }
}
<?php

function schema_570()
{
    return json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . '/api/570_schema.json'), true);
}
$schema = schema_570();
$start = '';
$end = $start + 20;
$items = array_slice($schema['items'], $start, $end);
foreach ($schema['items'] as $item) {
    $class = json_decode(get_data(), true);
}