summaryrefslogtreecommitdiff
path: root/src/DTS/Functions.php
blob: d7ca835400cb1bab23bece91034773032e5b2c0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php

declare(strict_types=1);

namespace DTS\Functions;

function respondAndExit(int $responseCode, string $header, string $body = '', array $headers = []): void
{
    header($header, false, $responseCode);

    foreach ($headers as $header) {
        header($header);
    }

    echo $body;

    exit();
}