你原来只有类似
date('H:i') >= $起始时间 and  date('H:i') < 结束时间
这样一条判别
加一条判别就是
date('H:i') >= $起始时间1 and  date('H:i') < 结束时间1
or
date('H:i') >= $起始时间2 and  date('H:i') < 结束时间2

解决方案 »

  1.   

    //提示时间检查
    $fromTime=strtotime(date('Y-m-d ',$this->time).$this->settings['cashFromTime'].':00');
    $toTime=strtotime(date('Y-m-d ',$this->time).$this->settings['cashToTime'].':00');
    if($this->time < $fromTime ||$this->time > $toTime ) throw new Exception("对不起,已过提现时间,请在合适的时间提交!<br />提现时间:".$this->settings['cashFromTime']." ~ ".$this->settings['cashToTime']); $this->beginTransaction();

    try{

    $this->freshSession();
    if($this->user['coinPassword']!=md5($para['coinpwd'])) throw new Exception('资金密码不正确');
    unset($para['coinpwd']);

    if($this->user['coin']<$para['amount']) throw new Exception('你帐户资金不足');这是代码
      

  2.   

    访问的时候你用php调取当前时间判断,如果是在允许时间内就继续运行,否则打道回府!
      

  3.   

    //提示时间检查
    $fromTime=strtotime(date('Y-m-d ',$this->time).$this->settings['cashFromTime'].':00');
    $toTime=strtotime(date('Y-m-d ',$this->time).$this->settings['cashToTime'].':00');
    if($this->time < $fromTime ||$this->time > $toTime ) throw new Exception("对不起,已过提现时间,请在合适的时间提交!<br />提现时间:".$this->settings['cashFromTime']." ~ ".$this->settings['cashToTime']); $this->beginTransaction();

    try{

    $this->freshSession();
    if($this->user['coinPassword']!=md5($para['coinpwd'])) throw new Exception('资金密码不正确');
    unset($para['coinpwd']);

    if($this->user['coin']<$para['amount']) throw new Exception('你帐户资金不足');
    目前是24小时制的,我需要的是跨天时间,比如08点到02点,上面是我的PHP代码,请问怎么改?
      

  4.   

    strtotime(date("Y-m-d")); //00:00
    strtotime(date("Y-m-d 02:00")); //02:00
    strtotime(date("Y-m-d 22:00")); //22:00
    strtotime(date("Y-m-d 24:00")); //24:00