php ให้ทำงานเมื่อเรียกใช้ในวันเวลาที่กำหนด

<?php
$start_time = '2014-05-30 12:00';
$stop_time = '2014-05-30 12:01';
if(check_time($start_time)>=0 and check_time($start_time)<=0){
echo 'ทำงาน';}
else{
echo 'ไม่ทำงาน';
}

function check_time($timeconfig){
$set_time = strtotime($timeconfig);
$now_time = strtotime(date('Y-m-d H:i:s'));
return $set_time-$now_time;
}
?>

แสดงความคิดเห็น

0 ความคิดเห็น