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:
In order to add bus/train/etc. schedule to your site:
- Download php-library file named
timetable.php
- Upload this file into your website (for example, into the root folder)
- Include 12Go library into the pages
include('/timetable.php');
- 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' ] ) -
Repeat point 4 on every page you need, changing function parameters:
get12GoTimetable('TH', 'Chiang Mai');
— all possible routes from Chiang Maiget12GoTimetable('TH', 'Suratthani', 'Bangkok');
— all possible routes from Suratthani to Bangkokget12GoTimetable('TH', 'Bangkok', 'Krabi', 'bus');
— all possible routes from Bangkok to Krabi by busget12GoTimetable('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 HTMLget12GoTimetable('TH', 'Bangkok', 'Chiang Mai', 'bus', null, null, 'cn');
— all possible routes from Bangkok to Chiang Mai by bus in Chineseget12GoTimetable('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!