View Single Post

  #11 (permalink)  
Old 11-16-2004
Pedro Graca
 
Posts: n/a
Default Re: Directory listing with file info

[ (-: Tenzel Kim Jensen? ]

Tenzel Kim wrote:
> Kim Jensen wrote:
>> I'd rather have links that read:
>>
>> Angelina Jolie
>>
>> than
>>
>> angelinajolie

>
> If I was just now creating the whole thing I
> could easily use the first examples as file names, but unfortunately I
> already have thousands of links using the second type of file names so
> going back and changing all of them manually or even by global
> search/replace would take ages.


Write a script to do that for you!

<?php
$oldfiles_dir = 'old/';
$newfiles_dir = 'new/';

foreach ($list as $val) {
/* get $charname :: fopen(), fgets(), fclose() */
copy($oldfiles_dir . $val, $newfiles_dir . $charname);
}

?>

And presto! :-)
--
Mail sent to my "From:" address is publicly readable at http://www.dodgeit.com/
== ** ## !! !! ## ** ==
TEXT-ONLY mail to the complete "Reply-To:" address ("My Name" <my@address>) may
bypass the spam filter. I will answer all pertinent mails from a valid address.
Reply With Quote