Re: filemtime problem
| From: | Marek Kilimajer | Date: | Sun, 20 Oct 2002 16:54:09 +0000 |
| Subject: | Re: filemtime problem | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-120672@lists.php.net to get a copy of this message | ||
Todd Cary wrote:
Right on!! Thanks! Design and parsing question: I need to keep the latest five files in a directory, so my design is to read in the file names with the date time as a prefix separated by a "|" (e.g. "2002 10 20 | myfile.txt") and put these into an array. Then I'll sort the array in decending order and delete all of the files but the top five. Is this a good design?why not using unix timestamp as keys ( array('1035494564' => 'yourfile.txt', ....) ), and then ksort the array.
If it is, I always get confused with the powerful string manipulation in PHP (I come from a Delphi background). How do I get the file name string from the concatenated string?and you don't need this
Todd -- Ariste Software, Petaluma, CA 94952