3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php //CREATE START TIME ARRAY $time_group = array('0000', '0030', '0100', '0130', '0200', '0230', '0300', '0330', '0400', '0430', '0500', '0530', '0600', '0630', '0700' , '0730', '0800', '0830', '0900', '0930', '1000', '1030', '1100', '1130', '1200', '1230', '1300', '1330', '1400', '1430', '1500', '1530' , '1600', '1630', '1700', '1730', '1800', '1830', '1900', '1930', '2000', '2030', '2100', '2130', '2200', '2230', '2300', '2330'); //CREATE FORMATED TIME ARRAY $time_name = array('Midnight', '12:30 AM', '01:00 AM', '01:30 AM', '02:00 AM', '02:30 AM', '03:00 AM', '03:30 AM', '04:00 AM', '04:30 AM', '05:00 AM', '05:30 AM', '06:00 AM', '06:30 AM', '07:00 AM' , '07:30 AM', '08:00 AM', '08:30 AM', '09:00 AM', '09:30 AM', '10:00 AM', '10:30 AM', '11:00 AM', '11:30 AM', 'Noon', '12:30 PM', '01:00 PM', '01:30 PM', '02:00 PM', '02:30 PM', '03:00 PM', '03:30 PM' , '04:00 PM', '04:30 PM', '05:00 PM', '05:30 PM', '06:00 PM', '06:30 PM', '07:00 PM', '07:30 PM', '08:00 PM', '08:30 PM', '09:00 PM', '09:30 PM', '10:00 PM', '10:30 PM', '11:00 PM', '11:30 PM'); $dotw = array('monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'); ?> <table width="425" border="0"> <? //Loop through the days of the week *DOTW* array $d = 0; while ($d <= 6) { /* NEED TO CREATE THE CONDITIONAL FOR EACH OPTION BELOW. if ($char_avail_stop_monday == "0000"){ echo "<option value=\"0000\" selected=\"selected\">Midnight</option>"; } else { echo "<option value=\"0000\">Midnight</option>"; } */ ?> <tr> <?php //echo "test: " .${char_avail_start_}.$d; if (${char_avail_start_}.$d == ""){ echo "<td width=\"190\" scope=\"col\"><span style=\"color: red\"><b>".ucfirst($dotw[$d])."</b></span></td>"; } else { echo "<td width=\"190\" scope=\"col\">".ucfirst($dotw[$d])."</td>"; } ?> <td scope="col"> <?php echo "<select name=\"char_avail_start_".$dotw[$d]."\" id=\"char_avail_start_".$dotw[$d]."\">\n"; //FIRST BLANK OPTION if ($char_avail_start_monday == ""){ echo "<option value=\"\" selected=\"selected\"></option>\n"; } else { echo "<option value=\"\"></option>\n"; } $i = 0; while ($i <= 47) { echo "<option value=\"".$time_group[$i]."\">".$time_name[$i]."</option>\n"; $i++; } echo "</select>\n"; echo "-\n"; echo "<select name=\"char_avail_stop_".$dotw[$d]."\" id=\"char_avail_stop_".$dotw[$d]."\">\n"; if ($char_avail_stop_monday == ""){ echo "<option value=\"\" selected=\"selected\"></option>\n"; } else { echo "<option value=\"\"></option>\n"; } $i = 0; while ($i <= 47) { echo "<option value=\"".$time_group[$i]."\">".$time_name[$i]."</option>\n"; $i++; } echo "</select></td></tr>\n"; $d++; } ?> </table>

Abusive script

This script was stopped while abusing our resources