FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » From city to lati and long
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: From city to lati and long [message #175025 is a reply to message #174991] Thu, 04 August 2011 08:03 Go to previous message
Paul Herber is currently offline  Paul Herber
Messages: 26
Registered: February 2011
Karma:
Junior Member
On Mon, 1 Aug 2011 14:20:03 -0700 (PDT), Sarah <dandi(dot)box(at)gmail(dot)com> wrote:

> Hi, I've created a PHP script that reads values from XML file
>
> and that calculate longi and lati
>
> $town = $event->town;
> $position = $town . " " . $city . " " . $state;
> $whereurl = urlencode($position);
> $location = file("http://maps.google.com/maps/geo?q=
> $whereurl&output=csv&key=ABQIAAAAvp3__HwvT3VkixIIbsW0axQuKI_6t1bH2P 0vCI_Q8jfpn8qdNBQMnneljxh9czilkau_bYSCXteS_A ");
> list ($stat,$acc,$latitude,$longitude) = explode(",",$location[0]);
>
>
> it works but sometimes lati and longi are both set to zero (in the
> same record) .... and if I re-execute script I show differents records
> set to zero .... can you help me?

Have you considered what happens if Google is slow to respond to your request?
Try using the cURL functions.



--
Regards, Paul Herber, Sandrila Ltd.
http://www.sandrila.co.uk/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: What is Islam?
Next Topic: Using function prototypes in code
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 30 09:14:07 GMT 2024

Total time taken to generate the page: 0.04328 seconds