>  I want to program php to calculate the distance between two zip codes.I
> only have zip codes,nothing else.How to do it?I'm completely lost.

You need to calculate the distance between the centroids of the zip
codes. Zip codes centroids (lat,lng pairs) are free and published.
(Search for "zip code centroid")

1) import the zip code data into your database
2) Use a formula to calculate the distance between the lat,lng pairs.
(just google for "haversine formula")

I assume you can fill in the rest, but let me know if that is not enough.

Regards,
John Campbell
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to