计算一段日期内的周末天数(星期六,星期日总和
摘要:function get_weekend_days($start_date,$end_date){ if (strtotime($start_date) > strtotime($end_date)) list($start_date, $end_date) = array($end_date, $start_date); $start_reduce = $end_add = 0; $start_N = date('N',strtotime($start_date)); $start_reduce = ($start_N == 7) ? 1 : 0; $end_N = d
阅读全文
根据指定两个日期计算出这些时间内有多少天是周末 php程序函数代码
摘要:$alldays = intval((sstrtotime($_POST['dayb']) - sstrtotime($_POST['daya'])) / 3600 / 24) + 1; //总天数 $weeks = intval($alldays / 7); //纯周数 $mdays = $alldays - 7 * $weeks; //除了纯周数外,余下那周的天数 if($mdays == '0') { $_POST['psdays'] = 5 * $weeks; $_POST['zmdays'] = 2 *
阅读全文
计算一段日期内的周末天数(星期六,星期日总和)(
摘要:function get_weekend_days($start_date,$end_date){ if (strtotime($start_date) > strtotime($end_date)) list($start_date, $end_date) = array($end_date, $start_date); $start_reduce = $end_add = 0; $start_N = date('N',strtotime($start_date)); $start_reduce = ($start_N == 7) ? 1 : 0; $end_N = d
阅读全文