Server IP : 162.240.98.243 / Your IP : 3.22.41.235 Web Server : Apache System : Linux server.bti.yaw.mybluehostin.me 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : btiyawmy ( 1003) PHP Version : 7.2.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/btiyawmy/public_html/patient.easenup.in/ |
Upload File : |
<?php function create_time_range($start, $end, $interval='30 mins', $format='12'){ $startTime = strtotime($start); $endTime = strtotime($end); $returnTimeFormat = ($format=='12')?'g:i:s A':'G:i:s'; $current = time(); $addTime = strtotime('+'.$interval,$current); $diff=$addTime-$current; $times=array(); while($startTime < $endTime){ $times[]=date($returnTimeFormat, $startTime); $startTime += $diff; } $times[]=date($returnTimeFormat,$startTime); return $times; } ?><?php $times=create_time_range('7:00','11:00','60 mins'); ?> <H1> Time Picker Dropdown Using Time Range</h1> <select name="time_picker"> <option value="">Select Time</option> <?php foreach($times as $key=>$val){ ?> <option value="<?php echo $val; ?>"><?php echo $val;?></option> <?php } ?> </select>