↓ Output (cached 60s)


<!DOCTYPE html>
<html lang="en">
  <head>
    <style type='text/css'>
      body {
        font-family: monospace;
        white-space: nowrap;
      }
      table {
        border-collapse: collapse;
      }
      th,td {
        border: 1px solid #eee;
        padding: 10px;
        vertical-align:top;
      }
      th:nth-child(1),th:nth-child(2) {
        text-align: left;
      }
      th:nth-child(3),td:nth-child(3) {
        text-align: center;
      }
      th:nth-child(4),td:nth-child(4) {
        text-align: right;
      }
    </style>
  </head>
  <body>
    <?php
      
require("OpenLDBWS.php");
      
$OpenLDBWS = new OpenLDBWS("YOUR_ACCESS_TOKEN");
      
$response $OpenLDBWS->GetDepBoardWithDetails(10,"GTW");
      
$template["header"] = "
        <table>
          <thead>
            <tr>
              <th>Time</th>
              <th>Destination</th>
              <th>Platform</th>
              <th>Expected</th>
            </tr>
          </thead>
          <tbody>
        "
;
      
$template["row"] = "
            <tr>
              <td>{std}</td>
              <td><strong>{destination}</strong>{detail}</td>
              <td>{platform}</td>
              <td>{etd}</td>
            </tr>
      "
;
      
$template["footer"] = "
          </tbody>
        </table>
      "
;

      if (isset(
$response->GetStationBoardResult))
      {
        print 
"<p><strong>".$response->GetStationBoardResult->locationName."</strong> Departures</p>";

        if (isset(
$response->GetStationBoardResult->nrccMessages))
        {
          print 
"<ul>";

          foreach(
$response->GetStationBoardResult->nrccMessages->message as $message)
          {
            print 
"<li>".$message->{"_"}."</li>";
          }

          print 
"</ul>";
        }

        if (isset(
$response->GetStationBoardResult->trainServices->service))
        {
          print 
$template["header"];

          foreach(
$response->GetStationBoardResult->trainServices->service as $service)
          {
            
$row $template["row"];

            
$destinations = array();

            foreach(
$service->destination->location as $location)
            {
              
$destinations[] = $location->locationName;
            }

            
$row str_replace("{std}",$service->std,$row);

            
$row str_replace("{destination}",implode(" and ",$destinations),$row);

            
$row str_replace("{platform}",(isset($service->platform)?$service->platform:"&nbsp;"),$row);

            
$row str_replace("{etd}",$service->etd,$row);

            
$detail "";

            if ((
$service->etd != "Cancelled") && isset($service->subsequentCallingPoints))
            {
              foreach(
$service->subsequentCallingPoints->callingPointList as $k => $callingPointList)
              {
                
$callingPoints $callingPointList->callingPoint;

                if (
$k)
                {
                  
$callingPoint array_shift($callingPoints);

                  
$detail .= "<p>Train divides at <strong>".$callingPoint->locationName."</strong></p>";
                }

                
$detail .= "<p>CALLING AT:</p>";

                foreach(
$callingPoints as $callingPoint)
                {
                  
$detail .= $callingPoint->locationName." (".(($callingPoint->st == "On time")?$callingPoint->et:$callingPoint->st).")<br />";
                }
              }

              
$detail .= "<p>".$service->operator.(isset($service->length)?" (".$service->length." coaches)":"")."</p>";
            }

            
$row str_replace("{detail}",$detail,$row);

            print 
$row;
          }

          print 
$template["footer"];
        }
        else
        {
          print 
"<p>No services within 2 hours.</p>";
        }
      }
    
?>
  </body>
</html>

Gatwick Airport Departures

Time Destination Platform Expected
22:40 Brighton

CALLING AT:

Three Bridges (22:44)
Haywards Heath (22:54)
Wivelsfield (22:59)
Burgess Hill (23:01)
Hassocks (23:05)
Preston Park (23:12)
Brighton (23:16)

Thameslink (12 coaches)

3 22:55
22:43 East Croydon

CALLING AT:

Horley (22:45)
Redhill (22:53)
Purley (23:04)
East Croydon (23:08)
London Bridge (23:25)

Southern (12 coaches)

1 23:06
22:46 Three Bridges

CALLING AT:

Three Bridges (22:51)

Thameslink (8 coaches)

3 On time
22:51 Worthing

CALLING AT:

Haywards Heath (23:03)
Burgess Hill (23:08)
Hassocks (23:12)
Preston Park (23:19)
Hove (23:22)
Portslade (23:26)
Southwick (23:29)
Shoreham-by-Sea (23:32)
Lancing (23:37)
Worthing (23:41)

Southern (8 coaches)

3 On time
22:54 London Bridge

CALLING AT:

East Croydon (23:11)
London Bridge (23:29)

Southern (8 coaches)

1 On time
22:55 Horsham

CALLING AT:

Three Bridges (22:59)
Crawley (23:03)
Horsham (23:12)

Southern (8 coaches)

3 23:11
23:00 Horsham

CALLING AT:

Three Bridges (23:05)
Crawley (23:09)
Ifield (23:12)
Littlehaven (23:18)
Horsham (23:22)

Thameslink

3 23:05
23:04 Reading

CALLING AT:

Redhill (23:14)
Reigate (23:20)
Betchworth (23:27)
Dorking Deepdene (23:31)
Dorking West (23:34)
Gomshall (23:42)
Chilworth (23:48)
Shalford (23:52)
Guildford (00:01)
Ash (00:10)
North Camp (00:15)
Farnborough North (00:19)
Blackwater (00:23)
Sandhurst (00:26)
Crowthorne (00:30)
Wokingham (00:36)
Reading (00:49)

Great Western Railway

1 On time
23:06 Brighton

CALLING AT:

Three Bridges (23:10)
Haywards Heath (23:20)
Burgess Hill (23:26)
Hassocks (23:30)
Brighton (23:40)

Southern (12 coaches)

3 On time
23:07 Bedford

CALLING AT:

East Croydon (23:22)
London Bridge (23:35)
London Blackfriars (23:41)
Farringdon (23:51)
London St Pancras (Intl) (23:55)
West Hampstead Thameslink (00:05)
St Albans (00:24)
Harpenden (00:31)
Luton Airport Parkway (00:36)
Luton (00:40)
Leagrave (00:45)
Harlington (00:50)
Flitwick (00:54)
Bedford (01:06)

Thameslink (12 coaches)

2 On time