You can try this.. It will also rename it to report (then the time in seconds since the unix epoc... Jan 1, 1970)
so it'll always be different, look something like...
report23904234.txt
That should loop through all the files in the directory (change the directory I have in there...!
if ($handle = opendir('.')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
$length = strlen($file);
$firstLetters = substr($file, 0, 2);
if($firstLetters == "uv") {
$newName = "report" . time() . ".txt";
rename($file, $newName);
} else {
echo "Does not begin with UV.<Br>";
}
}
}
closedir($handle);
}