Code that scares (scars?) the Nick.

So here I am, fixing code that one of our old, evil programmers wrote long ago, and I stumble across a script. This script needed a list of the days of the week, as well as some other day periods like “Monday-Friday”, in an array to put into a <select> box later, but the way this array is generated just… boggles the mind:

for($k=0; $k < 7; $k++ ){
    $days[] = date("l", strtotime("2006-05-".$k));
}
This entry was posted in Coding, PHP, WTF?!. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>