Jump to content

Postcode search geocode help


mackin

Recommended Posts

Hi, I have this code but i cant get it to work.

I have broken it down to sections and I think the get file contents may be at fault as when i dump the array it come back bool false.

The URL creates a page with CSV values of longitude and latitude from a postcode. I want to give the variables $custlat1 and $custlong1 the values from the geocoded co-ordinates.

 

The CSV values returned from the URL input are 200,5,54.1202442,-3.2078272

 

$pc1 = 'http://maps.google.com/maps/geo?q=la139hu,+UK&output=csv&sensor=false&key=ABQIAAAAcclaxnepdvvxx5D2PAnHtRSLcuoGw6G6HnB4VN4WqoMz7tmtKhTHGV82iKKTXvAg7YFpCFA6ptRc9g';
$data1 = @file_get_contents($pc1);
$result1 = explode(",", $data1);
$custlat1 = $result1[2];
$custlong1 = $result1[3];

 

can anyone help? or point me in the right direction

Link to comment
https://forums.phpfreaks.com/topic/252042-postcode-search-geocode-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.