PHP code example of irail / stations
1. Go to this page and download the library: Download irail/stations 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/ */
irail / stations example snippets
use irail\stations\Stations;
use irail\stations\StationsLd;
// Using the strongly typed CSV parser:
// getStations() returns a irail\stations\Station array
$brusselsnorth = Stations::getStations("Brussels North")[0];
// getStationByID($id) returns a irail\stations\Station object with the station or null
$ghentstpieters = Stations::getStationByID("http://irail.be/stations/NMBS/008892007");
// Using the linked-data interface
// getStations() returns a json-ld document
$brusselsnorth = StationsLd::getStations("Brussels North")->{"@graph"}[0];
// getStationByID($id) returns a simple object with the station or null
$ghentstpieters = StationsLd::getStationByID("http://irail.be/stations/NMBS/008892007");