使用php計算某日是幾天後

<?php
//未來日期的時間戳記
$exp = @strtotime($argv[1]);

//今天的時間戳記
$today = @strtotime(@date("Ymd"));

//相差的時間戳記除以86400
$days = (($exp-$today)/86400);

//即可得到未來的時間是幾天後
echo $days;

?>

arrow
arrow
    文章標籤
    php
    全站熱搜

    helloworld 發表在 痞客邦 留言(0) 人氣()