Wednesday, August 16, 2017

 

Train tickets booked with Bristol Air Bus - what if flight is late?

GWR will sell you tickets from "Bristol Air Bus" to your destination: tickets that include the bus from Bristol Airport to Bristol Temple Meads station, and train from there.

I have today (16 Aug 2017) had confirmation (from Andy Robinson in GWR telesales) that Advance tickets bought from "Bristol Air Bus" are valid on trains after the specific one booked if the passenger's flight arrives late into Bristol Airport.

He couldn't offer any documentary confirmation of this, but was adamant that the concession did apply.

Sunday, August 06, 2017

 

php to javascript via json_encode - beware negative keys in sparse arrays

The json-encode function in php is a neat way of getting data into javascript - but ...

... be careful with arrays.

If you have a non-sparse array then that can be encoded using json-encode($thisArray, true);

But a sparse array needs to be encoded the normal way - json-encode($thisArray); - and this creates an OBJECT rather than an ARRAY in javascript (which can't handle associative arrays)

The problem comes if your sparse array has a negative key. I hit this - the key will list if you iterate through the keys (albeit AFTER the positive keys!) but you can't access the value.

Ugh!

This page is powered by Blogger. Isn't yours?