mkerix / php-bvg
该软件包已被弃用,不再维护。未建议替代包。
PHP的BVG(柏林公共交通服务)非官方API。
0.1.2
2016-03-21 21:04 UTC
Requires
- php: ^7.0
- nesbot/carbon: ^1.21
- paquettg/php-html-parser: ^1.6
- rmccue/requests: ^1.6
Requires (Dev)
- phpunit/phpunit: 5.2.*
This package is not auto-updated.
Last update: 2021-06-09 08:46:17 UTC
README
PHP的BVG(柏林公共交通服务)非官方API。
安装
此软件包可在Packagist找到,并建议使用Composer进行安装。
$ composer require mkerix/php-bvg
使用方法
您可以使用搜索词搜索站点的ID
$stations = BVGApi\Station::getStations('alexanderplatz');
使用ID,您可以获取从给定时间点开始出发的班次,这表示为Carbon对象
$time = \Carbon\Carbon::create(2016, 3, 21, 12, 0, 0, 'Europe/Berlin'); $departures = BVGApi\Station::getDepartures(9100003, $time);