I receive a feed from a 3rd party, which includes a location string for each object.
I loop through each object, checking the location and storing a latitude/longitude value for it based on matching the location to a locations DB I have.
Sometimes, the location string isn't well formatted/ there are too many variations/ the locations DB just doesn't match anything.
I have setup an array in a config file of 'special locations' that I want to be able to match against should the location match fail.
e.g, in my array I will have:
Aberdeen => (
latitude => LATVAL,
longitude => LONGVAL
),
Greater London => (
latitude => LATVAL,
longitude => LONGVAL
)
and I may get an object from the feed with a location string of
'Aberdeen (EU Travel)'
and another may be:
'Aberdeen Airport, Grampia'
In these cases, I would want to match Aberdeen, and be able to get the associated lat/lon.
How can I check my array, to see if any keys are within the location string? or the location string contains a key from the array