I have a bit of script that deletes all .png files in a directory:
foreach (glob("*.png") as $filename) {
echo "$filename size " . filesize($filename) . "\n";
unlink($filename);
}
How do I take this one step further to delete all .png
files over a certain file size?
I have another bit of script that finds out the file size of all the files in the directory:
$bytes = filesize('example.png');
How do I combine the two?