Display 24 hours in a dropdown list using php



<!DOCTYPE html>
<html>
<body>
<?php
    $hour = 0;
    echo "<select>";
    while($hour++ < 24){
            $timetoprint = date('G:i',mktime($hour,0,0,1,1,2011));
            echo "<option >".$timetoprint."</option>";
    }
    echo "</select></div>";
    
?>
</body>
</html>

Post a Comment

0 Comments