2019年2月

当月总天数

echo date('t');

计算当前的时间距离下一个月还有多少天

function less_day(){
    $month_big = array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
    //现在的月份
    $date_month_old = (int)date('m',time());
    //下个月的月份
    $date_month_new = $date_month_old + 1;
    //下个月1号的时间戳
    $date_time_new = strtotime('1 '.$month_big[$date_month_new-1].' '.date('Y',time()));
    //今天的时间戳
    $date_time_old = strtotime(date('d',time()).' '.$month_big[$date_month_old-1].' '.date('Y',time()));
    //距下月剩余时间
    $time_new = ($date_time_new - $date_time_old)/24/60/60-1;
    return $time_new;
}
header("Content-type: text/html; charset=utf-8");
echo '今天是:'.date('Y-m-d',time()).'<br/>';
echo '距离下个月还有:'.less_day().'天';

以上内容转载自https://bobjin.com/blog/view/4994c03c126159ba64788a0be6d59d6c.html 尊重原作者的劳动成果

在body后添加

<body  oncontextmenu="return false" ondragstart="return false" onselectstart ="return false"  onselect="document.selection.empty()" oncopy="document.selection.empty()" onbeforecopy="return false"  onmouseup="document.selection.empty()"