平成30/ 2018-12-16 11:35
php/ 緯度経度 DMM => DEG(Degree)形式に変換

    foreach(array("lat", "lng") as $key){
        // 小数点は計算対象。それ以外は小数点が0ということなのでDMM形式をそのまま扱う。
        if(
        preg_match("/\.([0-9])/u", $row[$key], $match)
        ){
            // 数値の下2桁
            $target1 = 0;
            $target2 = 0;
            if(
            $match[1] > 1
            ){
                if(
                preg_match("/^([0-9]+)([0-9]{2})\.?/u", $row[$key], $match)
                ){
                    $target1 = $match[1];
                    $target2 = $match[2];
                }

            } else{
                if(
                preg_match("/^([0-9]+)([0-9]{1})\.?/u", $row[$key], $match)
                ){
                    $target1 = $match[1];
                    $target2 = $match[2];
                }
            }
            if(
            $target2
            ){
                // 小数点部分を加える
                $tmp = preg_split("/\./u", $row[$key]);
                $target2 += $tmp[1];                        // 132xx.xxxx のxx.xxxxの部分が取得できる
                $row[$key] = $target1 + ($target2/60);  // 132 + (xx.xxxx / 60) を行いDEG(degree)形式に変換
           }
        }
    }


// Thanks.
PHPで経度緯度をDMM(NMEA)からDegreeに変換
http://webcache.googleusercontent.com/search?q=cache:_uky06N6pSoJ:gps.sublimeblog.net/article/3695962.html+&cd=7&hl=ja&ct=clnk&gl=jp

経度緯度をDegreeからDMMに変換
http://gps2.blog27.fc2.com/blog-entry-32.html