The script is a distance measuring for point A to B
The problem is when multiplying the values it gives the same result?
Here is the code
Code: Select all
while( $i <= $count-1){
$lat_to = $xml->comp[$i]->address->latitude;
$long_to = $xml->comp[$i]->address->longitude;
print "lat_to=".$lat_to." and lat_to * 180 =".$lat_to = round($lat_to * 180,6);
print "long_to=".$long_to." and long_to * 180 =".$long_to * 180;
//distance($lat_from, $long_from, $lat_to, $long_to, $dist);
print $xmlout .=("<marker nr=\"m".$m."\" category=\"zillow\" address=\"".$xml->comp[$i]->address->street."\" name=\"".$xml->comp[$i]->address->street."\" price=\"".number_format($xml->comp[$i]->lastSoldPrice)." on ".$xml->comp[$i]->lastSoldDate."\" lat=\"".$xml->comp[$i]->address->latitude."\" lng=\"".$xml->comp[$i]->address->longitude."\" yrbuilt=\"".$xml->comp[$i]->yearBuilt."\" estimate=\"".$xml->comp[$i]->zestimate->amount."\" beds=\"".$xml->comp[$i]->bedrooms."/".$xml->comp[$i]->bathrooms."\" sqft=\"".$xml->comp[$i]->finishedSqFt."\" dist=\"".$xml->comp[$i]->zestimate->valueChange."\" />\n");
$lat_to = '';
$long_to = '';
$i++;
$m++;
}
return;
lat_to=33.478081 and lat_to * 180 =5940
long_to=-111.930272 and long_to * 180 =-19980
lat_to=33.46323 and lat_to * 180 =5940
long_to=-111.927663 and long_to * 180 =-19980
lat_to=33.464058 and lat_to * 180 =5940
long_to=-111.930228 and long_to * 180 =-19980
lat_to=33.459373 and lat_to * 180 =5940
long_to=-111.931393 and long_to * 180 =-19980
lat_to=33.483078 and lat_to * 180 =5940
long_to=-111.913447 and long_to * 180 =-19980
You can see the before (green)(lat_to=) then after it's multiplied * 180(red)
I left the round() with and without for showing purposes.
Any Ideas?
Thanks in advance
-Ken