View Single Post
Old 06-04-2008, 07:17 AM  
bigalownz
Confirmed User
 
bigalownz's Avatar
 
Industry Role:
Join Date: Aug 2005
Location: NEW ZEALAND
Posts: 1,657
Quote:
Originally Posted by testpie View Post
Here you go, just remember to change the DIR_HERE to the directory the files are in (e.g. /home/user/public_html/filedirectory/):
PHP Code:
<?php
## Variables
# Directory
$dir "DIR_HERE";

## Code
if($handle opendir($dir)) {
 print 
"<p>Processing files...</p>";
 
# Loop through files in dir
 
while(false !== ($file readdir($handle))) {
  
# Get file data
  
$data file_get_contents($file);
  
# Write data back to file
  
$fp fopen($file"w");
  
fwrite($fp$data);
  
fclose($fp);
  
# Give output
  
print "<p>Done &quot;".$file."&quot;</p>";
 }
 
# Close dir
 
closedir($handle);
}
print 
"<br /><p>Finished</p>"
?>
thanks for your help
will it change the date on all files?
as i just want .html to change
__________________
$100 free credit for all hosting needs
bigalownz is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote