PHP Generating Date-Based Drop-Down Menu Options – String Function

<?php
list($hour, $minute, $second, $month, $day, $year) = split(':', date('h:i:s:m:d:Y'));for ($i = 0; $i < 7; ++$i) {
    $timestamp = mktime($hour, $minute, $second, $month, $day + $i, $year);
    $date = date("D, F j, Y", $timestamp);
    print "<option value='$timestamp'>$date</option>\n";
}
?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.