PHP code example of trainjunkies-packages / schedule-json-parser

1. Go to this page and download the library: Download trainjunkies-packages/schedule-json-parser library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

trainjunkies-packages / schedule-json-parser example snippets


$handler = TrainjunkiesPackages\ScheduleJsonParser\Factory::create($jsonFilePath);

$meta = function($data) {
    var_dump($data);
};

$tiploc = function($data) {
    var_dump($data);
};

$association = function($data) {
    var_dump($data);
};

$schedule = function($data) {
    var_dump($data);
};

try {
    $handler->parse(
        $callback,
        $callback,
        $callback,
        $callback
    );
} catch (\Exception $e) {
    echo $e->getMessage() . PHP_EOL;
    exit(1);
}