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));
}