PHP code example of drusu-dev / itinerary-maker

1. Go to this page and download the library: Download drusu-dev/itinerary-maker 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/ */

    

drusu-dev / itinerary-maker example snippets



IM\ItineraryMaker;
use IM\Models\BusTicket;
use IM\Models\CustomTicket;

$tickets = [
    new BusTicket(
        '848484',
        new DateTime('2020-10-25 10:10:00'),
        new DateTime('2020-10-26 13:10:00'),
        'Southampton',
        'Newcastle',
        '112'
    ),
    new CustomTicket(
        '848484',
        new DateTime('2020-10-25 14:00:00'),
        new DateTime('2020-10-25 15:30:00'),
        '18-32 South Crees',
        'New Rd, Bolton Colliery NE35 9DR, United Kingdom',
        'taxi'
    ),
];

$im = (new ItineraryMaker($tickets))->create();
$output = $im->getTickets();
$instructions = $im->getInstructions();