Ⅰ PHP:編寫程序計算從當前時間距離2020年元旦還有多少天
$date_diff = date_diff(new DateTime(),new DateTime('2020-1-1'));
//object(DateInterval)#3 (8) { ["y"]=> int(6) ["m"]=> int(11) ["d"]=> int(23) ["h"]=> int(9) ["i"]=> int(44) ["s"]=> int(4) ["invert"]=> int(0) ["days"]=> int(2548) }
echo $date_diff->days; //2548