I want to create a dropdown that will take current time as start time and will end up till 24 hours, like till coming 24 hours so in between it will show time of every 15 minute
You can use DateTime for that:
$now = new DateTime();
$end = clone $now;
$end->modify("+24 hours");
while ($now <= $end) {
echo "<option>" . $now->format('h:i A'). "</option>";
$now->modify('+15 minutes');
}
there are a couple of things. First on your first line you are missing the second parameter. Then you are using $tNow undefined.
$current_time = date('h:i A', time());
$end_hour = date("+24 hours", strtotime($current_time));
$tNow = strtotime($current_time);
echo "<option>" . $current_time . "</option>";
for($i = 0; $i <= 96; $i++) {
echo "<option>" . date("h:i A", $tNow) . "</option>";
$tNow = strtotime('+15 minutes', $tNow);
}