asked on
$dir = "/uploads/";
$files = scandir($dir);
$nf = count($files);
echo "nf = " . $nf . "<br>";
for ($i = 0; $i < $nf; $i++) {
echo "file = " . $files[$i] . "<br>";
if ($files[$i] != "." && $files[$i] != "..") {
// check for Rep List
if (strpos($files[$i], "Rep List")) {
copy("/uploads/" . $files[$i], "/workspace/Rep_List.xlsx");
}
// check for Price Sheet
if (strpos($files[$i], "Price Sheet")) {
copy("/uploads/" . $files[$i], "/workspace/Price_Sheet.xlsx");
}
if (strpos($files[$i], "Movement")) {
copy("/uploads/" . $files[$i], "/workspace/Movement.xlsx");
}
}
}
uploads is a directory underneath the directory with the php program.