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

yipeiwu_com5年前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;
}
}
}

相关文章

php 判断访客是否为搜索引擎蜘蛛的函数代码

复制代码 代码如下: /** * 判断是否为搜索引擎蜘蛛 * * @author Eddy * @return bool */ function isCrawler() { $agent...

php生成txt文件实例代码介绍

这是一个朋友过来的 php 生成 txt 文件代码,这只是一个实例,需要我来给他生成多个 txt 文件实例的,但我觉得他这个代码有点意思,所以就分享上来了。 先说下这个 php 生成 t...

PHP中=赋值操作符对不同数据类型的不同行为

首先解释赋值操作符=的行为,看下面的例子: 复制代码 代码如下: $i = 0; $j = $i; $j = 0; echo $j; // 打印输出0 $arr = array(0);...

PHP swoole和redis异步任务实现方法分析

PHP swoole和redis异步任务实现方法分析

本文实例讲述了PHP swoole和redis异步任务实现方法。分享给大家供大家参考,具体如下: redis异步任务 interface.php <?php for($...

php 错误处理经验分享

本教程介绍了 PHP 中一些最为重要的错误检测方法。 我们将为您讲解不同的错误处理方法: 简单的 "die()" 语句 自定义错误和错误触发器 错误报告 基本的错误处理:使用 die()...