The code I have thus far is:
Code: Select all
//Check for original file
$myFile = "ReportFiles\\CustReportType1_*.csv";
if (file_exists($myFile)) {
unlink($myFile);
echo "The file $myFile has been Deleted";
} else {
echo "The file $myFile does not exist";
}
}
I tried using:
Code: Select all
foreach (glob("CustReportType1_*.csv") as $myFile) {
if (file_exists($myFile)) {
unlink($myFile);
echo "The file $myFile has been Deleted";
} else {
echo "The file $myFile does not exist";
}
}
What is the easiest way to include a wildcard search?