比较时间段一与时间段二是否有交集的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二分法在IP地址查询中的应用

数据库大概存储几十万条IP记录,记录集如下: +----------+----------+------------+---------+---------+--------+-----...

PHP中file_exists与is_file,is_dir的区别介绍

很显然file_exists是受了asp的影响,因为asp不但有fileExists还有folderExists,driverExists,那么PHP中file_exists是什么意思呢...

php 数组二分法查找函数代码

复制代码 代码如下:<?php //search函数 其中$array为数组,$k为要找的值,$low为查找范围的最小键值,$high为查找范围的最大键值 function sea...

PHP使用CURL实现对带有验证码的网站进行模拟登录的方法

网上的很多模拟登录程序,大都是通过服务程序apache之类的运行,获取到验证码之后显示在网页上,然后填上再POST出去,这样虽然看起来很友好,但是既然模拟登录,登录后所干的事情就不一定是...

PHP学习笔记之session

cookie和session是web开发新手容易搞混的两个概念,弄清楚两者有助于对web交互更好的理解。个人认为session和cookie的区别主要有如下几点: cookie 信息保存...