Try this,
$threeDbefore = date("Y-m-d", strtotime("-3 days"));
foreach(glob("path/to/files/*") as $file) {
if (!is_file($file)) {
continue;
}
$fileParts = explode('_', basename($file));
if(!empty($fileParts[0]) && $fileParts[0] <= $threeDbefore) {
unlink($file);
}
}
This will also delete files before 3 days, not just exactly 3 days. i.e it will delete '2014-01-24_backup.txt
and 2014-01-23_backup.txt
etc