Forum Moderators: coopster
$dd = sin($slat)*sin($dlat) + cos($slat)*cos($dlat)*cos($slon-$dlon);
$dist = acos($dd) * $earthradius;
$slon and $slat are the geographical longitude and latitude of the 'source' city, $dlon and $dlat are the same for the 'destination' city.
Southern latitudes and western longitudes are negative, all four values are expressed in radians.
$earthradius is planet earth's radius, (almost) exactly 6371 kilometers.
$dist will contain the distance between the two cities in kilometers (or express earth's radius in miles and get the distance in miles).
If that doesn't work, you could average all the different coordinates you have to get a "center point" for the city. It won't be perfect, but it should do the trick. :)