<?php
// cleanup_qrcodes.php
$temp_dir = '../temp_qrcodes/';

if (file_exists($temp_dir)) {
    $files = glob($temp_dir . '*.png');
    $now = time();
    
    foreach ($files as $file) {
        if (is_file($file)) {
            // Delete files older than 1 hour
            if ($now - filemtime($file) >= 3600) {
                @unlink($file);
            }
        }
    }
}
?>