<?php
// 國曆轉西元日期
//echo ROC_years_to_date('70/8/8');
//echo ROC_years_to_date('71/8/8','Y/m/d');
function ROC_years_to_date($date,$format='Y-m-d')
{
$arr = array();
preg_match_all("/[0-9]+/", $date , $arr);
$y = intval($arr[0][0])+1911;
$m = intval($arr[0][1]);
$d = intval($arr[0][2]);
return date($format,strtotime($y.'/'.$m.'/'.$d));
}
?>