<?php
// clear_errors.php - Clear error log
$log_file = __DIR__ . '/logs/php_errors.log';
if (file_exists($log_file)) {
    file_put_contents($log_file, '');
    echo "Log cleared at: " . date('Y-m-d H:i:s');
} else {
    echo "No log file found. Creating new log.";
    if (!is_dir(__DIR__ . '/logs')) {
        mkdir(__DIR__ . '/logs', 0777, true);
    }
    file_put_contents($log_file, "Log created at: " . date('Y-m-d H:i:s'));
}
?>