public function convertDecToDMS($coordinate) {

    $dms = array();
    $parts = explode('.', $coordinate);

    // The degrees portion.
    $dms['degrees'] = $parts[0];

    // Calculate the minutes
    $temp = ("0." . $parts[1]) * 3600;
    $dms['minutes'] = floor($temp / 60);

    // Find the seconds left over
    $dms['seconds'] = $temp - ($dms['minutes'] * 60);

    return $dms;
  }