Using the copy() Function

<?php
function move($source, $dest) {
if(!copy($source, $dest)) return false;
if(!unlink($source)) return false;
return true;
}

if(!move("data.txt", "/tmp/tmpdir/newfile.txt")) {
echo "Error! Couldn't move the file!<BR>";
}
?>

Post to Twitter Post to Digg Post to Facebook Post to Google Buzz Send Gmail

Leave a Comment

Your email address will not be published. Required fields are marked *