Geocoding with PHP
In my last
mentioned geocoding using the Yahoo Geocoding
API, so I thought
I’d post some code to do exactly that.
For the purposes of this example, assume that we have a very simple
MySQL database table with this structure:
Here’s the script:
The code is documented pretty well so I’ll just point out a couple
- The Yahoo Geocoding API can return either XML or PHP serialized
objects. I chose PHP serialized objects because it’s easier to deal
with for what I’m trying to do.
- http_build_query does not exist in PHP4. To use this code with
PHP4 you could use the PHP_COMPAT Pear