PHP code example of b3none / emtapi

1. Go to this page and download the library: Download b3none/emtapi 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/ */

    

b3none / emtapi example snippets


$emtapi = \B3none\emtapi\EMTClient::create();
$emtapi->createStationsFile();
$emtapi->getJourneys(\B3none\emtapi\Station::DERBY, \B3none\emtapi\Station::NOTTINGHAM);

[
    'trains' => [
        0 => [
            'locationname' => 'Nottingham',
            'st' => '16:40',
            'et' => 'On time',
            'cssclass' => null,
            'operator' => 'CrossCountry',
            'trainid' => '+eRxw6w7A8UJsGRGIAT5Ag==',
            'platform' => '6A',
            'selecteddets_sta' => '16:34',
            'selecteddets_location' => 'Derby',
            'selecteddets_length' => '23 minutes',
            'selecteddets_prevlength' => '2 hours, 55 minutes',
            'callingpoints' => [
                '0' => [
                    'locationname' => 'Long Eaton',
                    'st' => '16:34',
                    'et' => 'On time',
                    'cssclass' => null
                ]
            ],
            'previouscallingpoints' => [
                0 => [
                    'locationname' => 'Cardiff Central',
                    'st' => '13:45',
                    'et' => null,
                    'cssclass' => 'circle-full',
                    'at' => 'On time'
                ]
            ]
        ]
    ]
]