php 当前时间 当前时间戳和数据库里取出的时间datetime格式进行比较大小
UNIX时间戳转换为日期用函数: date() ,date('Y-m-d H:i:s', 1500219870);
日期转换为UNIX时间戳用函数:strtotime() ,strtotime('-10-23 02:17:16');
实例:
$endTime = $mydata->endTime;if($endTime != NULL){$endTime = strtotime($endTime);$nowTime = time();if($nowTime > $endTime){$data['result'] = "你的账号已过期,请联系管理员续费重新开通!";$this->load->view ( '/resultview',$data);return;}}