$startTime = str_replace(":", "", 11:30);
$endTime = str_replace(":", "", 16:00);
$currentTime = str_replace(":", "", date('H:i'));
if ($currentTime >= $startTime)
{
$buttons = '<a href="javascript:void(0)" class="btn btn-success btn-sm">Start Exam</a>';
}
else if($currentTime < $startTime)
{
$buttons = '<a href="javascript:void(0)" class="btn btn-info btn-sm">Please wait till start time..</a>';
}
else if($currentTime <= $endTime)
{
$buttons = '<a href="javascript:void(0)" class="btn btn-danger btn-sm">Exam Over</a>';
}
In the above code. What happen now when start time and current time is equal or current time is greater then start time then it show start exam but it not working properly. So, How can I compare start and end time with current time? Please help.
Thank you