当前位置:首页 > PHP教程 > PHP高级教程

比较时间段一与时间段二是否有交集的php函数

复制代码 代码如下:

/*
*比较时间段一与时间段二是否有交集
*/
function ismixtime($begintime1,$endtime1,$begintime2,$endtime2)
{
$status = $begintime2 - $begintime1;
if($status>0){
$status2 = $begintime2 - $endtime1;
if($status2>0){
return false;
}else{
return true;
}
}else{
$status2 = $begintime1 - $endtime2;
if($status2>0){
return false;
}else{
return true;
}
}
}


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:)!