I have a need to display decimal degrees stored in the database as three separate fields (Degrees, Minutes, Seconds) on a web page.
I have tried to use PHP 4.1.2 coding to convert the decimal degrees from the database, but have sem to have run into some PHP problems where it will not assign a floating point value to a variable based upon a calculation (?).
$lat = OCIresult($curEntire,"SITE_LATITUDE");
$ddLatArray = explode(".", $lat);
$dLAT = $ddLatArray[0];
if (strstr($lat, ".") != 0) {
$mmLat = ".".$ddLatArray[1];
$divi = (int) (60);
$mmmLat = $mmLat * 60;
$ddLatmArray = explode(".", $mmmLat);
$mLAT = $ddLatmArray[0];
}
The code seems to bomb when assigning the value for $ddLatmArray. Need some other way of getting the desimal degrees and extracting the minutes and seconds out of it.
Any tricks to handle this?