diff options
| author | David T. Sadler <davidtsadler@googlemail.com> | 2021-10-06 21:22:38 +0100 | 
|---|---|---|
| committer | David T. Sadler <davidtsadler@googlemail.com> | 2021-10-06 21:22:38 +0100 | 
| commit | 82f4871c3ef07a821d18e217ca2aa5711de10105 (patch) | |
| tree | 150cc3e03cd8ddc4fc090deee1df2e337760b72c /src/DTS/Functions.php | |
| parent | c2ca1dbe0cdfb6924bcafa7f05ce09baaf1d101d (diff) | |
Add functions file
Diffstat (limited to 'src/DTS/Functions.php')
| -rw-r--r-- | src/DTS/Functions.php | 18 | 
1 files changed, 18 insertions, 0 deletions
diff --git a/src/DTS/Functions.php b/src/DTS/Functions.php new file mode 100644 index 0000000..b7f9cb3 --- /dev/null +++ b/src/DTS/Functions.php @@ -0,0 +1,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(); +}  | 
