0
I created a way to delete multiple files from a folder via Mysql.
Variables of Mysql:
$location_files = $listed['ads_image_1'];
$location_files2 = $listed['ads_image_2'];
$location_files3 = $listed['ads_image_3'];
Array where go poles:
$remove_files = array($location_files, $location_files2, $location_files3);
Function where will eliminate them:
if(file_exists($remove_files)) {
$files = glob($remove_files); // get all file names
foreach($files as $file){ // iterate files
if(is_file($file))
unlink($file); // delete file
}
}
But a mistake happened. Someone could help?
Error:
Warning: file_exists() expects parameter 1 to be a valid path, array given in D:\xampp\htdocs\Superfacil_v1.7.9\myads.php on line 819 (if(file_exists)...
Very thankful! This is what I was failing! I’m already Good Reply.. Give me 1min
– user21312321