Jump to content

rename, copy, delete files


sheraz

Recommended Posts

<?php
$file = 'example.txt';
$newfile = 'example.txt.bak';

if (!copy($file, $newfile)) {
echo "failed to copy $file...\n";
}
?>

 

Straight from php.net

 

With directories...

 

<?php
$file = 'original/dir/example.txt';
$newfile = 'new/dir/example.txt.bak';

if (!copy($file, $newfile)) {
echo "failed to copy $file...\n";
}
?>

 

We can't help you surther unless you post your code

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.