src/Lootils/Geo/Earth.php
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;
  }
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;
  }
Convert a coordinate into Degree Minute Second format.

@param float $coordinate
The coordinate in decimal format to convert.

@return array
An array with the keys degrees, minutes, and seconds