Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.