Soshot/app/Utils/DeleteGen.php

19 lines
405 B
PHP
Raw Permalink Normal View History

<?php
namespace App\Utils;
class DeleteGen {
function deleteGen(string $hashFile) {
$dir = __DIR__ . '/../../cache/img/' . substr($hashFile, 0, 4) . '/';
if (is_dir($dir)) {
$listFile = glob($dir . '*');
foreach ($listFile as $file) {
if (is_file($file)) {
unlink($file);
}
}
}
}
}