$a = 123123123123; //2009-04-07
$b = 123111113311; //2009-05-09
$c = 122223232332; //2009-04-15if($c < $b && $c > $a){
 //C在A B之间
}

解决方案 »

  1.   

    用strtotime函数做换算
    $aa=strtotime($a);
    $bb=strtotime($b);
    $cc=strtotime($c);
    if($aa>$cc and $cc<$bb){
    print "$c在$a和$b之间";
    }
      

  2.   

    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
      

  3.   

    转换成时间戳<?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>";?>