jump to navigation

NOTE: The spam filter is being unusually aggressive. If you comment does not immediately appear, it has simply been placed in moderation and I will approve it as quickly as possible. Thank you for your patience.

"Murphy was an optimist!"

DailyWTF August 5, 2008 6:33 am

Posted by Doug McCaughan in : PHP, Programming, Technology
, trackback

I wrote this piece of rocket science last night:

<select id="birthdateyear" name="birthdateyear">
   <?php for($byear = date("Y",time()); $byear >= 1901; $byear--){ ?>
      <option value="<?php echo $byear; ?>" <?php if($birthdateyear == $byear) echo "selected"; ?>><?php echo date("Y",mktime(12,1,1,1,1,$byear)); ?></option>
   <?php } ?>

And that is why you shouldn’t code tired.

Comments after advertisement


no comments yet - be the first?