PHP code example of lsv / rejseplan-php-api

1. Go to this page and download the library: Download lsv/rejseplan-php-api 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/ */

    

lsv / rejseplan-php-api example snippets


$client = new \Symfony\Component\HttpClient\HttpClient(); // Any PSR-18 http client can be used
\Lsv\Rejseplan\AbstractRequest::setClient($client);

$location = '123'; // Location should be either a string, integer or a StopLocation
$board = new \Lsv\Rejseplan\ArrivalBoard($location);
$response = $board->request();
// $response is now a ArrivalBoardResponse