Enjoy!
function wgs84($n) {
$one = substr($n, 0, 2);
list($first, $second) = explode('.', $n);
list($two, $none) = explode('.', (('0.' . $second) * 60));
$tworaw = ('0.' . $second) * 60;
list($first, $second) = explode('.', $tworaw);
list($three, $none) = explode('.', (('0.' . $second) * 60));
return $one . '° ' . $two . '′ ' . $three . '″';
}
$decimal = '59.2943';
print wgs84($decimal); // 59° 17′ 39″
Wow this is a great resource.. I’m enjoying it.. good article