Name Last modified Size Description Parent Directory 10-Jun-2002 15:37 - 23) { $namecut = substr($name, 0, 23); } // for consistancy we use the name $namecut from now on for the cut name, even if it wasn't cut else { $namecut = $name; } // if $day only has one digit (1-9), add a preceding 0 to the number to match the format if (strlen($day) == 1) { $day = "0" . $day; } // same for the hour, add a 0 if it's only one digit in length if (strlen($hour) == 1) { $hour = "0" . $hour; } // same for the minutes, add a 0 if it's only one digit in length if (strlen($minutes) == 1) { $minutes = "0" . $minutes; } // if the file name did not take up all 23 characters, we need to add some space if (strlen($name) != 23) { $space = str_pad("", (23 - strlen($namecut))); } // again with the number padding, this time add two spaces to the filesize if its only one digit in length if (strlen($filesize) == 1) { $filesize = " " . $filesize; } // add only one space to the filesize if its already two digits in length if (strlen($filesize) == 2) { $filesize = " " . $filesize; } // construct the entire line print(" $namecut$space $day-$month-$year $hour:$minutes " . $filesize . "k"); // go back to the start of the for-loop, recreate the random names and numbers, print out all the needed lines } ?>