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 "" . $now->format('h:i A'). ""; $now->modify('+15 minutes'); }