怎么实现这个日期是否在两个日期段中间?请看代码说明! $a = 123123123123; //2009-04-07$b = 123111113311; //2009-05-09$c = 122223232332; //2009-04-15if($c < $b && $c > $a){ //C在A B之间} 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用strtotime函数做换算$aa=strtotime($a);$bb=strtotime($b);$cc=strtotime($c);if($aa>$cc and $cc<$bb){print "$c在$a和$b之间";} 2009-04-07这个是怎么转为123123123123?function gettime($str) { $temp=explode("-",str_replace(array(":"," "),"-",trim($str))); return mktime($temp[3],$temp[4],$temp[5],$temp[1],$temp[2],$temp[0]); } $str="2009-04-07"; $tem=gettime($str); echo $tem; //结果是12414816001239062400 转换成时间戳<?php$a='2009-04-08';$b='2009-05-09';$c='2009-04-15';$arr = explode('-',$a);$a = mktime(0,0,0,$arr[1],$arr[2],$arr[0]); $arr = explode('-',$b);$b = mktime(0,0,0,$arr[1],$arr[2],$arr[0]); $arr = explode('-',$c);$c = mktime(0,0,0,$arr[1],$arr[2],$arr[0]); echo $a."<br>";echo $b."<br>";echo $c."<br>";?> php正则表达式的一个取值问题 php怎么实现mp3的连续播放? 怎样向已经设计好格式的excel中,向指定的单元格中写出数据 Nginx下WordPress的Rewrite 效率问题 用biffwriter导出的excel文件,不能用PHPExcelParser4解析出来? 如何用session判断用户的在线状态. 有的網站用一個動態頁面引導到一個下載地址最后客戶端得到一個不同的文件,怎么實現的? 关于日语支持的问题 [超简单问题]如何在PHP中控制print的输出格式? 虚拟主机上的MySQL数据库一般怎么备份? 控制概率设计问题,帮帮忙,谢谢各位大哥大姐!急!
$aa=strtotime($a);
$bb=strtotime($b);
$cc=strtotime($c);
if($aa>$cc and $cc<$bb){
print "$c在$a和$b之间";
}
{
$temp=explode("-",str_replace(array(":"," "),"-",trim($str)));
return mktime($temp[3],$temp[4],$temp[5],$temp[1],$temp[2],$temp[0]);
}
$str="2009-04-07";
$tem=gettime($str);
echo $tem; //结果是12414816001239062400
$a='2009-04-08';
$b='2009-05-09';
$c='2009-04-15';$arr = explode('-',$a);
$a = mktime(0,0,0,$arr[1],$arr[2],$arr[0]); $arr = explode('-',$b);
$b = mktime(0,0,0,$arr[1],$arr[2],$arr[0]); $arr = explode('-',$c);
$c = mktime(0,0,0,$arr[1],$arr[2],$arr[0]);
echo $a."<br>";
echo $b."<br>";
echo $c."<br>";?>