PHP code example of trafiklab / sl-php-sdk
1. Go to this page and download the library: Download trafiklab/sl-php-sdk 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/ */
trafiklab / sl-php-sdk example snippets
$departuresRequest = new SlTimeTableRequest();
$departuresRequest->setStopId("1000");
$slWrapper = new SlWrapper();
$slWrapper->setUserAgent("<YOUR_USER_AGENT>");
$slWrapper->setTimeTablesApiKey("<YOUR_API_KEY>");
$response = $slWrapper->getTimeTable($departuresRequest);