60 * 60 * 24) { if (preg_match('/\.jpg$/i', $file)) { echo "Deleting $file\n"; unlink($path . $file); } } } }