<?php

// core/helpers.php

function e($value)
{
    return htmlspecialchars((string)$value, ENT_QUOTES, 'UTF-8');
}

function redirect($path)
{
    header("Location: " . $path);
    exit;
}

function format_price($price, $decimals = 5)
{
    return number_format((float)$price, $decimals, '.', '');
}

function current_datetime()
{
    return date('Y-m-d H:i:s');
}