Timetable integration as an PHP library

Dear Partner, if you want to have actual timetable on your site, you can use 12go.com Timetable Service.

In order to add bus schedule to your site:

  1. Download php-library file named timetable.php
  2. Upload this file into your website (for example, into the root folder)
  3. Include 12Go library into the pages include('/timetable.php');
  4. Put the function calls into your website template: get12GoTimetable('TH', 'Bangkok', 'Koh Samui');

    string get12GoTimetable ( string $country , string $from [, string $dest = null ]
    [, string $class = null ] [, bool $noreturn = null ] [, bool $lesslinks = null ] [, string $lang = 'en' ] [, string $curr = 'THB' ] )

  5. Repeat point 4 on every page you need, changing function parameters:
    get12GoTimetable('TH', 'Chiang Mai'); — all possible routes from Chiang Mai
    get12GoTimetable('TH', 'Suratthani', 'Bangkok'); — all possible routes from Suratthani to Bangkok
    get12GoTimetable('TH', 'Bangkok', 'Krabi', 'bus'); — all possible routes from Bangkok to Krabi by bus
    get12GoTimetable('TH', 'Bangkok', null, 'train, ferry', true, true); — all possible one way routes from Bangkok to any destination by train or ferry, without unnecessary links in return HTML
    get12GoTimetable('TH', 'Bangkok', 'Chiang Mai', 'bus', null, null, 'cn'); — all possible routes from Bangkok to Chiang Mai by bus in Chinese
    get12GoTimetable('TH', 'Bangkok', 'Suratthani', 'train', null, null, 'ru', 'RUB'); — all possible routes from Bangkok to Suratthani by train in Russian with prices in RUB

Write us if you have any questions!